Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8374043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:50:03+00:00 2026-06-09T14:50:03+00:00

I can receive a byte array from a Socket . I need to play

  • 0

I can receive a byte array from a Socket. I need to play audio from this byte array – the audio is encoded with AMR 8000Hz.

I found that I can play AMR audio with MediaPlayer. However, MediaPlayer can’t play music from byte array, and I don’t want to write them to file.

Is there a way to play AMR sound from byte array on android?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T14:50:04+00:00Added an answer on June 9, 2026 at 2:50 pm

    The Android framework allows you to play back audio data directly from memory using the AudioTrack class; the drawback is that the audio must already be decoded into PCM data. If you are lucky enough to target Android 4.1, there are new APIs that allow you to decode the data separately so it can be passed to AudioTrack (see MediaExtractor and MediaCodec). However, prior to that there were no exposed APIs for encoding/decoding beyond MediaRecorder and MediaPlayer.

    If targeting a version of Android prior to 4.1 (which I imagine you probably are) you have two options:

    • Find a 3rd party decoder for the AMR data so you can pass it on to AudioTrack
    • Save your data to a file (even temporarily) so it can be handed to MediaPlayer

    HTH

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Following a protocol document, I can receive an array of parameters encoded as an
I have to send a byte array (encoded photo) from my PHP client to
I have to send the audio data in byte array obtain by recording from
I receive some xml-files with embedded base64-encoded images, that I need to decode and
I have a small byte array (under 25K) that I receive and decode as
I am writing a byte array from a socket client as: byte[] arr =
This is a C# Winforms App in .NET 4.0. I receive a byte array
I have an array of bytes that I receive from an external entity. It
I want to make an app that can receive broadcast when other apps on
When learning C I see that printf can receive many arguments as it is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.