ios - No sound issue kills audio for all apps on the device -


we losing sound (no sound) in our app, somehow causing other apps lose sound. don't know how possible block sound external app apple music app.

we dumping contents of our avaudiosession session , there no differences can see between when sound working , not. have verified route output still iphone's speaker, when lost sound.

this happening on iphone 6s & 6s plus speaker. can "fix" audio changing output route, such plug in , unplug headphones.

how possible impact ability play sound of other apps, may troubleshoot happening?

we tracked down source of problem having bad data in audio buffer sent core audio. specifically, 1 of audio processing steps output data nan (not number), instead of float in valid range of +/- 1.0.

it appears on devices, if data contains nan, kills audio of whole device.

we worked around looping through audio data checking nan values, , converting them 0.0 instead. note checking if float nan strange check (or seems strange me). nan not equal anything, including itself.

some pseudocode work around problem until new libraries have proper fix:

float        *interleavedaudio; // pointer buffer of audio data unsigned int  numberofsamples;  // number of left/right samples in audio buffer unsigned int  numberofleftrightsamples = numberofsamples * 2; // number of float values in audio buffer  // loop through each float in audio data (unsigned int = 0; < numberofleftrightsamples; i++) {     float *sample = interleavedaudio + i;      // nan never equal anything, including     if( *sample != *sample )     {         // sample nan - force 0.0 doesn't corrupt audio         *sample = 0.0;     } } 

Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -