Closed hanllo closed 4 years ago
You code looks correct so it looks like a bug.
I've fixed this issue in the latest push to master but need to finalize some large changes to the iOS aspect of the project so I won't be doing doing a release until those are complete. That being said if you're in a hurry and not worried about iOS for the moment you could clone the code in master or if you already have a local copy of the API make the changes yourself as they are quite simple. The files that need to be changed are under sounds -> lib > media_format.
For each file ending in media_format paste
sampleRate: sampleRate, numChannels: numChannels, bitRate: bitRate,
Into each of the constructors where the args are being passed up to the parent class.
Constructors should end up looking like this
const AdtsAacMediaFormat({ int sampleRate = 16000, int numChannels = 1, int bitRate = 16000, }) : super.detail( name: 'adts/aac', sampleRate: sampleRate, numChannels: numChannels, bitRate: bitRate, );
I'm having some trouble changing the sampleRate and bitRate of recordings from their default values of 16000. If anyone has done this and could help me out I'd really appreciate it.
Here's my startRecording function, in which I set the mediaFormat including sampleRate/bitRate as shown in the SoundRecorder documentation:
Here's the relevant output: