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

  • Home
  • SEARCH
  • 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 8202667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:15:59+00:00 2026-06-07T07:15:59+00:00

Im stuck on an issue on my objective C App. I’m reading a byte

  • 0

Im stuck on an issue on my objective C App.

I’m reading a byte array from a serveur (Socket c#) who send me an PCM encoded sound, and i’m currently looking for a sample code that decode for me this byte array (NSData), and play it.

Does anyone know a solution ? Or how can I read a u-Law audio?

Thanks a lot ! 😀

  • 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-07T07:16:01+00:00Added an answer on June 7, 2026 at 7:16 am

    This link has information about mu-law encoding and decoding:

    http://dystopiancode.blogspot.com.es/2012/02/pcm-law-and-u-law-companding-algorithms.html

    #define MULAW_BIAS 33
    /*
     * Description:
     *  Decodes an 8-bit unsigned integer using the mu-Law.
     * Parameters:
     *  number - the number who will be decoded
     * Returns:
     *  The decoded number
     */
    int16_t MuLaw_Decode(int8_t number)
    {
     uint8_t sign = 0, position = 0;
     int16_t decoded = 0;
     number=~number;
     if(number&0x80)
     {
      number&=~(1<<7);
      sign = -1;
     }
     position = ((number & 0xF0) >>4) + 5;
     decoded = ((1<<position)|((number&0x0F)<<(position-4))|(1<<(position-5)))
                - MULAW_BIAS;
     return (sign==0)?(decoded):(-(decoded));
    }
    

    When you have the uncompressed audio you should be able to play it using the Audio Queue API.

    Good luck!

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

Sidebar

Related Questions

I am stuck in a strange issue while reading data from serial port in
I am stuck on an issue with reading data from a server. The data
I am stuck at a Local to Global Point issue in Objective C ViewController
After reading similar questions with many variants, I'm still stuck on this issue. Here's
Stuck with this particular issue. I have code that get lots of pages from
Im working in objective C++. The issue I am stuck with is that I
I am stuck on a issue. I am trying to set user-environment variables using
I am stuck with this issue for a long time. I searched for this
I am stuck on this issue and cannot seem to find a way around
I am kind of stuck with an issue where I am unable to to

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.