Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: Testing the new "audio-recorder" application.

  1. #11
    Join Date
    Jan 2006
    Location
    Palmela, Portugal
    Beans
    660

    Re: Testing the new "audio-recorder" application.

    Hello Mocha,
    Can you provide more information.
    1) Download the latest version of the program (if you compiled it from source). There have been some minor changes.

    2) Start the program from command line with --debug-signal=1 option.
    $ audio-recorder -d 1

    Activate the timer. Audio-recorder will now print signal levels in the terminal window.

    3) Play this test signal.
    http://www.futuredesktop.com/tmp/test-sound.ogg
    (I generated it with this... python script)

    4) After the test-sound.ogg finishes, take copy of the outputted lines and paste them to Ubuntu's paste-bin, here: http://paste.ubuntu.com/

    And show the pastebin URL here so we can grab the data.

    Notice:
    Code:
    Time: 0:01:10.419047619: rms=-16.3dB (15.3%) peak=-0.5 dB(97.7%) decay=-0.5 dB. Value count=20 Avg.rms=-23.8dB (6.7%).
    dB = decibel, and % is dB value converted to 0 - 100%.
    Only the "rms=" and "Avg.rms=" values have meaning here. The other values (peak and decay) are not used or tested by the program, only printed.

    The value_count runs from 0 to 50 (defined in gst-listener.c module). 50 values represent ca. 5 seconds of data.

    Avg.rms = sum(rms values)/value count.

    The timer simply calls listener_get_average_rms(...) to get the values. This functions is defined in gst-listener.c. See also timer_test_silence(...) in timer.c.

    So the mechanism is very simple. It may need improvements.
    Last edited by moma; March 4th, 2011 at 12:33 PM.

  2. #12
    Join Date
    Sep 2006
    Beans
    548

    Re: Testing the new "audio-recorder" application.

    I played with your program some more and now I understand a few things better. First of all in order to do a line-in capture properly with your program, one needs to load the pulseaudio loopback module, otherwise your program appears to only sample once per second from the non-monitor source. Secondly, it appears that your "silence" test can only go as low as 1 second, and it doesn't accept fractional input like 0.5s. Another issue that causes me a few problems is that the silence test is based on the average rms value, which kind of screws up sound detection in my opinion. For example, if I'm recording a line-in source that is intermittent, and if there is sound for a few seconds the average rms might go up to -17 dB, but then when the sound stops it takes awhile for that average value to drop down below the threshold, so the program just records silence for a few seconds, but the amount of "few seconds" is different every time depending on how long the last burst of audio was. Also, the fact that you can't do less than 1 second threshold screws up sound detection in the opposite manner, meaning that very short bursts of audio are not detected and therefore nothing is recorded.

    I really like your program, if you could fix these few things it would be much more useful. I am trying to record intermittent audio coming over a line-in, which is probably not what you intended this program to originally be for.

    These types of programs for Linux intrigue me because there is very few of them, whereas in the Windows world there are many; "scanner recorder", vox-record, rec-all pro, etc... The only 2 things that I have found that work good on Linux for this is Audacity, a python script I found, and now your program is in the league but it needs a few tweaks first. I will try playing with source later.
    Last edited by mocha; March 3rd, 2011 at 09:43 AM.

  3. #13
    Join Date
    Jan 2006
    Location
    Palmela, Portugal
    Beans
    660

    Re: Testing the new "audio-recorder" application.

    Many thanks for your input.

    > The "silence" test can only go as low as 1 second, and it
    > doesn't accept fractional input like 0.5s.

    You are right. The timer_test_silence(...) function in timer.c counts whole seconds. Notice also that the Timer itself sleeps 2 seconds between each call. See the TIMER_CALL_FREQ variable at the top of the timer.c module. Study also the timer_func_start() function which creates the timer thread.

    > Another issue that causes me a few problems is that the
    > silence test is based on the average rms value, which kind
    > of screws up sound detection in my opinion.

    That's right. It uses avg.rms value for all silence/sound/audio/voice tests.

    This audio-recorder uses GStreamer, and its "level" element was the best way to get the signal-data. Ref.:
    http://www.gstreamer.net/data/doc/gs...ins-level.html
    --

    Do we agree that the RMS value is the best way to detect the signal level? I don't think we can use the Peak and Decay values for anything useful?

    Based on your indication:
    Maybe we should stop using avg.RMS, and collect RMS values directly. Like this

    A) gst-listener.c collects RMS data for the last few seconds.
    See gst-listener.c, function listener_set_data(...).

    B) Timer wakes up each (1) second and reads the RMS data for the last (1) second from gst-listener.c.
    See timer.c, function timer_test_silence(...).
    And gst-listener.c, listener_get_average_rms(...).

    Link to timer.c module.

    Link to gst-listener.c module

    I really need help to make this program better.
    Notice: I'm a programmer and have relatively little knowledge about sound and audio systems. I simply made this app to record audio from radio and TV-broadcasts on the net. Audio-recorder uses GStreamer to do the listening and recording jobs.
    ---
    EDIT: Be careful when you test the timer commands.
    Test one (1) command at a time. For example, these two commands;
    start if voice 1s -22dB
    pause if silence 1s -22dB

    may cause a conflict (but I haven't tested it).

    You only need the the first line.
    start if voice 1s -22dB
    It will automatically pause temporarily when the signal drops under the given value.
    Last edited by moma; March 4th, 2011 at 03:15 PM.

  4. #14
    Join Date
    Mar 2007
    Beans
    Hidden!

    Re: Testing the new "audio-recorder" application.

    I can't seem to record correctly with Skype. It records my Microphone input, however the remote side sound playing through my speakers does not get recorded.

    I have tried all possible combinations in Advanced settings for Playback Devices. What can I do to troubleshoot ?

  5. #15
    Join Date
    Jan 2006
    Location
    Palmela, Portugal
    Beans
    660

    Re: Testing the new "audio-recorder" application.

    Hello Sheedatali,
    EDIT: Yes, I can see your problem.
    The Skype module (dbus-skype.c) is pretty nice but I need to find a better way to melt the voice channels from microphone + loudspeaker to one recording. I need to review the entire Skype module. I may seek help from GstMixer..... Most likely I need to change the GStreamer-pipeline to include two separate audio sources. Wish me luck. Many thanks for your observation.

    EDIT: Ok, here is a GStreamer pipeline that combines two sound sources to one recording.
    It takes microphone input + sound from the speakers and records it all to test1.oga file.

    Using the GstInterleave... element.
    $ gst-launch interleave name=i ! level name=level ! "audio/x-raw-float,rate=44100,channels=2" ! \
    vorbisenc name=enc quality=0.5 ! oggmux ! \
    filesink name=output-sink location=test1.ogg \
    pulsesrc device=alsa_input.usb-Creative_Technology_Ltd._VF0610_Live__Cam_Socializ e_HD_091214_b_00556-02-HD.analog-mono name=source1 ! \
    queue name=q1 ! audioconvert ! i. \
    pulsesrc device=alsa_output.pci-0000_04_02.0.analog-stereo.monitor name=source2 ! queue name=q2 ! audioconvert ! i.


    Notice: the device names in the above command are spesific for this machine and system.

    It's also possible to add ! volume volume=0.3 ! fragment after the queue elements. This will control the volume (0.0 - 1.0).

    Here is an other example, that records from 3 audio devices. Using the GstAdder... element.
    $ gst-launch-0.10 adder name=mix ! audioconvert ! vorbisenc ! oggmux ! filesink location=test1.ogg {
    pulsesrc device=alsa_input.usb-Creative_Technology_Ltd._VF0610_Live__Cam_Socializ e_HD_091214_b_00556-02-HD.analog-mono ! queue ! mix.
    } { pulsesrc device=alsa_output.pci-0000_04_02.0.analog-stereo.monitor ! queue ! mix. }
    { pulsesrc device=alsa_output.pci-0000_00_1b.0.analog-stereo.monitor ! queue ! mix. }


    @Sheedatali: Things looks very promising. The GUI will also need changes because, when recording from the Skype, the user must select both the sound-card device (loudspeaker) and microphone device.
    Last edited by moma; March 5th, 2011 at 07:29 PM.

  6. #16
    Join Date
    Sep 2006
    Beans
    548

    Re: Testing the new "audio-recorder" application.

    Moma,

    I downloaded your source and want to look into this more since your program has the most promise to be the most refined voice activated recording program for Linux.

    A) gst-listener.c collects RMS data for the last few seconds.
    See gst-listener.c, function listener_set_data(...).

    B) Timer wakes up each (1) second and reads the RMS data for the last (1) second from gst-listener.c.
    See timer.c, function timer_test_silence(...).
    And gst-listener.c, listener_get_average_rms(...).
    Yes I think it would be much better to use a fixed period to calculate the average, otherwise it takes too long for the average value to fall back below the threshold value, and you end up with varying amounts of recorded silence.

    I want to use your program to record scanner radio broadcasts, like public safety radio stuff, police, fire, etc. There is a lot of intermittent audio from these sources, so it is nice to do pausing on silence. It is also nice to be able to program a fixed amount of silence after the last broadcast. The sequence of events is like this:

    1. Wait for audio above threshold xx dB.
    2. Start recording.
    3. When instantaneous levels drop below threshold, record for xx seconds more.
    4. Stay paused until condition 1.

    I also want to say that I appreciate your use of gstreamer, it is clearly the best choice because the savvy user can make their own pipelines for on the fly encoding decisions. Audacity and the python script only record to WAV.

    In the past I've also attempted to script sox with its silence command, but it never worked properly for realtime recording.

    Here's a link to the python script I was talking about.

  7. #17
    Join Date
    Jan 2006
    Location
    Palmela, Portugal
    Beans
    660

    Re: Testing the new "audio-recorder" application.

    Hello,
    I have made some changes to the audio-recorder.

    It's now possible to select one or more devices for recording. Take a look at this picture.


    @Sheedatali: Recording from Skype should now work.

    I haven't uploaded the new code to the Launchpad yet, but will do it during this coming week.

    EDIT 15.march.2011
    Hello again,
    I have now uploaded the code to Launchpad.
    Please update your source and recompile. I do not dare to create ready-made packages yet.
    We need to test the source and all its functions first

    EDIT 16.march.2011
    I just uploaded some more updates.
    Please see also bug-reports and comments on
    https://bugs.launchpad.net/audio-recorder

    EDIT 18.march.2011
    There are now packages for Maverick and Natty. Version 0.4 has been delivered.
    https://launchpad.net/~osmoma/+archive/audio-recorder

    EDIT 19.march.2011
    Only Natty needs libappindicator-dev package.
    I removed libappindicator-dev package from Maverick. Changed build-dependencies in debian/control file.
    Last edited by moma; March 22nd, 2011 at 12:48 PM.

  8. #18
    Join Date
    Feb 2010
    Beans
    3

    Lightbulb Re: Testing the new "audio-recorder" application.

    Hi ... newbie here, but will weigh in with what I can.

    My only need for audio recording on a consistent basis has been frequent Skype conversations, for which "Skype Call Recorder" was the 'application of choice'.

    However, with the recent Ubuntu 11.10 upgrade, that piece of software has been rendered worthless.
    Ergo audio-recorder has come in to the picture as a possible solution.

    Strictly for the purposes of recording Skype voice chat, I find the current version of audio-recorder unsatisfactory, when compared to that which it is needed to replace; i.e. Skype Call Recorder. Let me be specific ... with SCR you were able to 'dumb down' the bitrate and sample rate so that the resultant mp3 was 'light'. Given that Skype calls are - for the most part - simply glorified telephone calls, 44.1kHz and 192kb are simply unnecessary. Not only is it overkill in terms of quality, but it also results in a file size that is excessive for its intended purpose. It also exceeds what VoIP is typically capable of.

    8kHz to 16kHz is more than enough for sampling rate for the resultant mp3 for voice calls through VoIP.
    Similarly, telephone typically has a bit rate of 8kbit/s. Even if using 16kbit/s or 32kbit/s ... its a heck of a stretch to justify needing 192!!

    This is reflected in the Windows only software that is available specifically for Skype here:
    http://voipcallrecording.com/Skype_Call_Recorder ... which is NOT the recorder I was using pre-Upgrade, but DOES have the 32kHz sampling option to better reflect the needs of voice call capturing.

    Now ... consider the comparative resultant filesizes when holding up the "current audio-recorder mp3" versus the "required audio-recorder mp3".

    For other applications - I can't comment or offer anything.
    However, for Skype recordings, I think it is an admirable attempt, and a welcome solution, but for it to be meaningful [for my personal requirements], it requires some adjustments.

    To put that into context, I am regularly involved [daily] in Skype 'think tanks' and discussion groups, which last from 45mins to 2hr30mins. The mp3 that is produced then needs to be promulgated to a wider group. The audio-recorder mp3 filesize is prohibitive.

    Again - hope this feedback helps.
    My requirements are very specific, but in terms of being a Skype recorder, maybe the comments about it being excessive in terms of recording quality may have some merit?

    Cheers.
    Last edited by Yozhik; October 18th, 2011 at 04:25 PM.

Page 2 of 2 FirstFirst 12

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •