3

If i use the Android MediaRecorder to record i file i can set its properties like this:

this.recorder.SetAudioSource(AudioSource.Mic);
this.recorder.SetOutputFormat(OutputFormat.AmrWb);
this.recorder.SetAudioEncoder(AudioEncoder.AmrWb);
this.recorder.SetAudioSamplingRate(16000);

It generates a 3gpp-File. If i send the recorded file to the Google Cloud Speech API the audio is recognized and transformed into text:

var response = speech.SyncRecognize(new RecognitionConfig()
            {
                Encoding = RecognitionConfig.Types.AudioEncoding.AmrWb,
                SampleRate = 16000,
                LanguageCode ="de-DE"
            }, RecognitionAudio.FromFile("test.3gpp"));

However, if i change the OutputFormat to

this.recorder.SetOutputFormat(OutputFormat.ThreeGpp);

it also generates a .3gpp-File, but the Google Cloud API throws an error. That's strange, because i thought the OutputFormat doesn't matter and just defines the container of the encoded data which are AMR encoded in both cases. So my question is:

What exactly is the difference between the AMR and the ThreeGpp OutputFormat?

Tobias von Falkenhayn
  • 1,355
  • 5
  • 26
  • 59
  • Usually 3GPP is video container holds both AudioStream ( Can be AMR/AAC..) and VideoStream (Can be MP4) – Ajay May 01 '17 at 15:00
  • So its a container or a format? What is the difference between a "container" and a "audio format"? I always thought an audio file consists of a container (defining the file extension) containing header informations and one or multiple decoded audio data, using a specific codec. also so i'm wondering why the 3gpp container format does not work with the google cloud speech api. – Tobias von Falkenhayn May 01 '17 at 16:38

0 Answers0