Reputation: 3071
what are the default bit rate values required for creating .mp3 file? I have app which created .mp3 audio file. When is set bit rate vales to the avaudiorecorder settings the file is getting created. But for some reason it cannot be played in avAudioPlayer. Any idea why this can be?
Upvotes: 1
Views: 674
Reputation: 28335
two parameters drive audio bit rate ... Bit Depth ( typically 16 bit ) and Sample Rate ( typically 44.1kbps ) ... multiply these together and you have your Bit Rate ( also multiply by channel count so stereo is 2X) which is generally not explicitly set
Now regarding how to store audio ... various compression techniques ... lossy or not ... often results in a variable Bit Rate which may be the issue here especially since common flavors of mp3 are variable bit rate
If you define bit depth and sample rate it should work without explicitly defining bit rate ... when these settings are wrong you will still get sound so your issue may be unrelated if you get no audio
this answer says iOS cannot record mp3 instead use aac ... from 2014
Upvotes: 1