nicolas2k / google-glass-api

Automatically exported from code.google.com/p/google-glass-api
1 stars 0 forks source link

Default Setting for Audio Recording Does Not Record in the Right Format #317

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Here is my code for recording audio using the Google Glass. The output file for 
this code seems to be recording at a much lower frequency. Attached is also the 
output file. 

recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);       recorder.setAudio
Encoder(MediaRecorder.AudioEncoder.DEFAULT);

Original issue reported on code.google.com by chuazy on 20 Dec 2013 at 6:40

Attachments:

GoogleCodeExporter commented 8 years ago
another file, this time 

recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);

Original comment by chuazy on 20 Dec 2013 at 6:48

Attachments:

GoogleCodeExporter commented 8 years ago
Works if
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);

File attached.

Original comment by chuazy on 20 Dec 2013 at 6:50

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by ala...@google.com on 6 Jan 2014 at 5:21

GoogleCodeExporter commented 8 years ago
Hello,

After further investigation, we decided to mark this as "WorkingAsIntended": as 
you found out, the default encoder is AMR_NB which is why you are getting this 
output.

Both codec are valid and optimized for different type of use-cases: it is up to 
you to choose the one you prefer for your application.

Best,
Alain

Original comment by ala...@google.com on 8 Jan 2014 at 4:19

GoogleCodeExporter commented 8 years ago
I see. May I know what is the use case for AMR_NB, because the output is not 
exactly human-hearable. Why isnt the default AAC instead?

Original comment by chuazy on 9 Jan 2014 at 7:29

GoogleCodeExporter commented 8 years ago
Of course: AMR-NB uses the sample frequency of 8kHz. It is in the lower side, 
and is usually mainly used for speech signal. If you want to use for music and 
the other purpose, it is not the right codec.

Original comment by ala...@google.com on 9 Jan 2014 at 4:19