Active Topics

 


Reply
Thread Tools
Posts: 111 | Thanked: 50 times | Joined on May 2015
#1
I am a great fan of recording live music. I was trying to use for this my N900, but I am very disappointed with the results. First of all - almost every application designed for recording ( I mean orecchiette, voicenote, recorder, mydicto etc.) use pcm (and in effect wav files) which consumes a lot of space in memory. When I was trying to record music with orccchiette and AAC codec, I got "flowing" sound with unacceptable quality (48 kHz, 2 channel 128 kbit/s). The best sound records stock camera application when it is in video recording mode. Audio is then in mp4a format and sounds really great (as for this kind of device). Can anybody tell me how to record compressed sound with good quality.
 

The Following 4 Users Say Thank You to NotMicro For This Useful Post:
pichlo's Avatar
Posts: 6,447 | Thanked: 20,981 times | Joined on Sep 2012 @ UK
#2
Originally Posted by NotMicro View Post
I got "flowing" sound
What is "flowing" sound?

with unacceptable quality (48 kHz, 2 channel 128 kbit/s).
What is unacceptable about that?

Can anybody tell me how to record compressed sound with good quality.
I would (and do) record as WAV and post-process with ffmpeg. An hour of WAV recording is just a few hundred MB, not a big deal if you do not keep it permanently.

Code:
ffmpeg -i file.wav file.mp3
(If running on the phone, prepare for a loooong run )
__________________
Русский военный корабль, иди нахуй!
 

The Following 7 Users Say Thank You to pichlo For This Useful Post:
mosen's Avatar
Community Council | Posts: 1,669 | Thanked: 10,225 times | Joined on Nov 2014 @ Lower Rhine
#3
I guess he means the recording is unacceptable despite using decent freq range and bitrate?

+1 for raw recording.
With n900 i used "recorder" on phone and later at home direct ffmpeg source path on my laptop to n900 sftp mount so i do not need to first copy and then encode large recodings.

From my experience it takes around 1.5 times original play time to encode raw to aac on n900. Which could also be the cause for problems with live encoding i guess?
 

The Following 6 Users Say Thank You to mosen For This Useful Post:
Posts: 29 | Thanked: 88 times | Joined on Oct 2015
#4
- if you want rec from headset mic, in xterm:
Code:
gst-launch-0.10 -e pulsesrc device=source.hw0 ! audio/x-raw-float,channels=1 ! audioconvert ! nokiaaacenc bitrate=64000 output-format=0 ! hantromp4mux ! audio/x-m4a ! filesink location=/home/user/MyDocs/audio.m4a
amixer -qc0 set "Input Select" ADC
this set gain for it (0-127), here is 60
Code:
amixer -qc0 set PGA 60
- if you want rec from builded in mic, in xterm:
Code:
amixer -qc0 set "Input Select" "Digital Mic"
gst-launch-0.10 -e pulsesrc device=source.record ! audio/x-raw-float,channels=1 ! audioconvert ! nokiaaacenc bitrate=64000 output-format=0 ! hantromp4mux ! audio/x-m4a ! filesink location=/home/user/MyDocs/audio.m4a
make sure that capture is on:
Code:
amixer -q cset name='Capture Switch' on
amixer -qc0 cset name='PGA Capture Switch' on

Last edited by ontime; 2017-06-05 at 22:44.
 

The Following 7 Users Say Thank You to ontime For This Useful Post:
Posts: 111 | Thanked: 50 times | Joined on May 2015
#5
Originally Posted by ontime View Post
- if you want rec from headset mic, in xterm:
Code:
gst-launch-0.10 -e pulsesrc device=source.hw0 ! audio/x-raw-float,channels=1 ! audioconvert ! nokiaaacenc bitrate=64000 output-format=0 ! hantromp4mux ! audio/x-m4a ! filesink location=/home/user/MyDocs/audio.m4a
amixer -qc0 set "Input Select" ADC
this set gain for it (0-127), here is 60
Code:
amixer -qc0 set PGA 60
- if you want rec from builded in mic, in xterm:
Code:
amixer -qc0 set "Input Select" "Digital Mic"
gst-launch-0.10 -e pulsesrc device=source.record ! audio/x-raw-float,channels=1 ! audioconvert ! nokiaaacenc bitrate=64000 output-format=0 ! hantromp4mux ! audio/x-m4a ! filesink location=/home/user/MyDocs/audio.m4a
make sure that capture is on:
Code:
amixer -q cset name='Capture Switch' on
amixer -qc0 cset name='PGA Capture Switch' on


Wow! Just great ! I see that you are a real professional. Thank you for this complete answer. I will try this method as soon as possible.

I have only one more question: is there any chance to record stereo sound using, for example, usb microphone. Or maybe there is a way to use standard external stereo mic connected to minijack in N900?
 

The Following 2 Users Say Thank You to NotMicro For This Useful Post:
Posts: 29 | Thanked: 88 times | Joined on Oct 2015
#6
for usb stereo mic, you need:
- driver for it which will be working on n900
- h-e-n - it's in repository
- OTG cable
- some app that can rec from your mic (gstreamer, audacity, etc)

it's simple when you have all that components

second solution but not perfect:
- use build in mic as left channel
- use headset mic as right channel
- mix both into audio file (maybe gsteamer can do that)

minijack in n900 has only one input, so only mono (can be multiplexed, but that need specific mics and specific app on n900, not worth of thinking)

I use nokia e52 for record stereo sound. It has build in two mics.
 

The Following 3 Users Say Thank You to ontime For This Useful Post:
Posts: 119 | Thanked: 217 times | Joined on Feb 2015 @ Poland
#7
Originally Posted by ontime View Post
for usb stereo mic, you need:
- driver for it which will be working on n900
- h-e-n - it's in repository
- OTG cable
- some app that can rec from your mic (gstreamer, audacity, etc)

it's simple when you have all that components

second solution but not perfect:
- use build in mic as left channel
- use headset mic as right channel
- mix both into audio file (maybe gsteamer can do that)

minijack in n900 has only one input, so only mono (can be multiplexed, but that need specific mics and specific app on n900, not worth of thinking)

I use nokia e52 for record stereo sound. It has build in two mics.
Or even better use Nokia n9. It.by default records nice videos with stereo sound. It also suppports stereo line-in(not sure about n900, its video cable is compatible, maybe stereo too). You can use similar gstreamer hacks, but there are already good apps for stereo/mono recording.eith input selection.
 

The Following 3 Users Say Thank You to badpixel For This Useful Post:
Posts: 29 | Thanked: 88 times | Joined on Oct 2015
#8
third option:
- stereo bluetooth mic
- n900 should recognise it as stereo? (fm radio turns on bluetooth and it's stereo)

fourth:
- stereo FM mic
- n900 has stereo FM receiver

Or even better use Nokia n9. It.by default records nice videos with stereo sound. It also suppports stereo line-in(not sure about n900, its video cable is compatible, maybe stereo too).
in n900 alsamixer shows jack function:
- headphone
- headset
- mic
- eci headset (if headset has many buttons, like play, vol+, vol- etc. then it's probably ECI accessory)
- tv out
- off
so it seems no line-in, neo900 has

You can use similar gstreamer hacks, but there are already good apps for stereo/mono recording.eith input
yes, gstreamer is for people who likes look into interior. btw, do you know some light & fast app for cut m4a, mp4 without decoding/encoding?
 

The Following 3 Users Say Thank You to ontime For This Useful Post:
Posts: 111 | Thanked: 50 times | Joined on May 2015
#9
Originally Posted by ontime View Post
- if you want rec from headset mic, in xterm:
Code:
gst-launch-0.10 -e pulsesrc device=source.hw0 ! audio/x-raw-float,channels=1 ! audioconvert ! nokiaaacenc bitrate=64000 output-format=0 ! hantromp4mux ! audio/x-m4a ! filesink location=/home/user/MyDocs/audio.m4a
amixer -qc0 set "Input Select" ADC
this set gain for it (0-127), here is 60
Code:
amixer -qc0 set PGA 60
- if you want rec from builded in mic, in xterm:
Code:
amixer -qc0 set "Input Select" "Digital Mic"
gst-launch-0.10 -e pulsesrc device=source.record ! audio/x-raw-float,channels=1 ! audioconvert ! nokiaaacenc bitrate=64000 output-format=0 ! hantromp4mux ! audio/x-m4a ! filesink location=/home/user/MyDocs/audio.m4a
make sure that capture is on:
Code:
amixer -q cset name='Capture Switch' on
amixer -qc0 cset name='PGA Capture Switch' on

I am very sorry for long delay in my answers. Thank you very much once again for your posts. I have though more questions:

- how to stop recording
- when I use commands described in your post I get file "audio.m4a" but it is not playable (even no time of recording is seen in any player). It has size but it seems that there is nothing in it.
 

The Following 3 Users Say Thank You to NotMicro For This Useful Post:
Posts: 29 | Thanked: 88 times | Joined on Oct 2015
#10
ah, right
for manual stop, press Ctrl+c in the same terminal
or
send SIGINT (kill -2 $PID) to gstreamer:
Code:
kill -2 `pidof gst-launch-0.10`
 

The Following 3 Users Say Thank You to ontime For This Useful Post:
Reply

Tags
audio recording, nokia n900


 
Forum Jump


All times are GMT. The time now is 19:25.