How to record voice messages

How to do things, solutions, recipes, tutorials
Message
Author
User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

How to record voice messages

#1 Post by Lobster »

Use this method now (link to posting later in this thread)
http://www.murga-linux.com/puppy/viewto ... 684#141684

Old info
Use from Multimedia menu
Soxgui audio tool
  • select directory

    wav

    8000

    mono

    enter filename
click on record
speak
and stop when finished

(the file can get large so . . .

open a terminal where the file is saved (right click with rox)
and type

lame -a -h -b 24 --nspsytune --resample 22 --lowpass 7 tmx2.wav


just swap tmx2.wav for your wav file
this will create an mp3 file that is a fifth of the size of the wav file

the file created will be called (for example)
tmx2.wav.mp3
if sending to a Windows user
change name to tmx2.mp3

example rant from Lobster created using this system
http://www.tmxxine.com/sound/tmx2.wav.mp3
Last edited by Lobster on Mon 24 Sep 2007, 04:42, edited 1 time in total.
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

Firefox
Posts: 172
Joined: Fri 03 Nov 2006, 12:38
Location: UK

Broadcast

#2 Post by Firefox »

Hi Lobster

Tried your latest broadcast in 2.17 pup. Download didnt make it in gxine - after 2 buffer fills it closed down. Tried right click save as and got a terribly slow download 2-3 kb/s managed 214 k before it said finished, instead 0f the 2014kb it should be. The sound is still low even after turning the speakers way up. I know its not your fault but there has to be a bug somewhere in all this.

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#3 Post by Lobster »

Oh dear :(

Normally I am using the latest Puppy
so can give some feedback.
Could it be the compression or new kernel of 2.17

thing is I have gone back to 2.16.1 (in fact Linux Tmxxine)
http://tmxxine.com/Wikka/wikka.php?wakka=LinuxTmxxine10

I downloaded and it was OK for me :D

If it is a problem with my host then it can be hosted elsewhere? Someone who can download? :)

2.17.1 will be out in a few days at the most and 2.18 will be a more robust version of 2.17

. . . other than that do not know what to suggest :?
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

Greystar
Posts: 26
Joined: Tue 20 Mar 2007, 23:56

#4 Post by Greystar »

Lobster i'm running 2.16.1 and no problems streaming but like your last pawcast for me.(all others a little low but were audible) I have to turn up puppy sound mixer all the way up my volume on the speakers all the way up then put my ear to the speakers to just hear it faintly.

other mp3's play fine with mixer to 80 and speaker volume to 30.

hope that helps some?

by the way i do like listening to your pawcasts.

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#5 Post by Lobster »

Thanks :)
m m m . . .

that means I would have to also run the audio boost in Soxgui

OK let me have a go and get back to you :)

8)
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#6 Post by Lobster »

example rant from Lobster created using this system
http://www.tmxxine.com/sound/prism.mp3

OK I used the sound adjust in Sox gui - sounds a bit crackly . . .
Did it get cut short?
any better?
Last edited by Lobster on Thu 19 Feb 2009, 16:50, edited 2 times in total.
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

Firefox
Posts: 172
Joined: Fri 03 Nov 2006, 12:38
Location: UK

#7 Post by Firefox »

Hi Lobster

The sound level is allright- using headphones from side speakers.
The sound is a bit crackly and gxine cut short your voice after 3 buffer refils. Maybe its my machine and ram related? have 128Mb or else need to configure gxine somehow maybe with special codecs or drivers. I have them but not installed yet, This test was of a pristine 2.17.1 frugal install on hda3 using gxine straight out of the box.

Greystar
Posts: 26
Joined: Tue 20 Mar 2007, 23:56

#8 Post by Greystar »

Volumes very good could hear it on my normal settings listed above.It is a little crackly (almost sounds like an electrical hum like whe you get to close to an old monitor.) But very audible. As for the cut off message did seem to cut off a little over a minute and a half or so(didn't know if intentional due to test or just cut off) but streamed perfect to that point.




edited by me to add about streaming and cut off.

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#9 Post by Lobster »

:cry:

Yes I got the cut off when just clicking the file
somehow the gxine mem buffer is too small

what I found is right clicking and downloading (and then running locally) and it was OK

the crackle - m m m - it really is a compromise (to get a small file) one thing you can do is use the equaliser in gxine

Ideal would be a mod to the Sox_gui code that set for voice (and used lame as described above to convert to Mp3) and added a crackle filter

ah well getting there . . .
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

mp3 or ogg on the fly?

#10 Post by mcewanw »

Good information thanks. My only problem is that I don't have much disk space for the wav files. Is there any way, that you know, to pipe through some utility such as LAME and get mp3 output without having to first save wav to harddisk? My young daughter has been set the task of recording a teach-"me" german book to audio... :-)

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#11 Post by Lobster »

I don't know.
The reason I saved to wav initially was because it was a reliable format. I had difficulty saving at low bit rates or converting to other formats. I did not have the hard disk constraints you mention.

It might be worthwhile using audacity if you have a lot of editing to do
http://www.murga-linux.com/puppy/viewto ... 3429#13429

:)
Last edited by Lobster on Thu 19 Feb 2009, 16:50, edited 1 time in total.
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

commandline recording to mp3

#12 Post by mcewanw »

Yes, audacity is great. I once undertook a documentary film making course and I used audacity to edit some of the soundtracks.

Since receiving your message, I've found an interesting howto on the net: "Recording audio from the commandline"

Here is the link:
http://jordilin.wordpress.com/2006/07/2 ... mand-line/

I haven't tried it yet, but it seems to be exactly what I'm looking for in terms of having low disk space requirements. It does indeed involve piping the audio through lame. Here is an extract from the howto blurb:

"In this howto I’m going to give you powerful tools to record sound directly to an mp3 file or ogg file from the command line. So, you will be able to record for hours and hours your favourite music without having to worry about your hard disk space".

These are the main commands discussed:

arecord -f cd -t raw | lame -x - out.mp3
[I've since tried the above and it seems to work! Enter the command in, for example, an rxvt console window; press Ctrl-C to stop recording]

or, for time-limited mp3 record:

arecord -f cd -d numberofseconds -t raw | lame -x - out.mp3

or, for ogg vorbis output:

arecord -f cd -t raw | oggenc - -r -o out.ogg

As you know Puppy already comes with lame installed. arecord is already in Puppy too! :-)
If you want the ogg vorbis format instead of mp3 you need to find and install vorbis-tools.

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

arecord also works with Lobster's lame command options

#13 Post by mcewanw »

I haven't studied the lame command line options at all as yet, but I tried mixing what you already said, Lobster, with the arecord pipe to lame method. Seemed to work too. Gives nice tiny mp3 output files without having to save any big wav files first!:

arecord -f cd -t raw | lame -a -h -b 24 --nspsytune --resample 22 --lowpass 7 -x - out.mp3

[Once again, enter the above command in, for example, an rxvt console window; press Ctrl-C to stop recording]

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#14 Post by Lobster »

I do not have the oggenc

Code: Select all

bash: oggenc: command not found
not sure why . . .

this worked OK and is very convenient - many thanks :)

Code: Select all

arecord -f cd -t raw | lame -a -h -b 24 --nspsytune --resample 22 --lowpass 7 -x - out.mp3 
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

you'd need to download and install vorbis-tools

#15 Post by mcewanw »

Lobster wrote:I do not have the oggenc

Code: Select all

bash: oggenc: command not found
not sure why . . .
Both arecord and lame are in the standard Puppy distribution, so the mp3 commandline works fine, but oggenc is not in Puppy; you'd have to download and install vorbis-tools (from somewhere...) if you wanted ogg files instead of mp3.

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

Simple arecord2lamegui record direct to mp3 dotpet:

#16 Post by mcewanw »

NOTE:
1. New program based on this work is now available called "[W]reckedLeg" Voice Memo Recorder. You can download it from the announcement thread for new apps at:

http://www.murga-linux.com/puppy/viewto ... 435#144435

2. Since the original work on arecord2lamegui, I've achieved much better sound quality, when recording from a microphone, using rec (from sox) rather than arecord itself. Hence, I've changed the following blurb to concern rec2lamegui rather than arecord2lamegui. I've also now attached a dotpet for rec2lamegui-0.4 here. It is no different to arecord2lamegui-0.4.pet except for the use of rec instead of arecord. I've also left arecord2lamegui-0.4.pet for download too, in case you want to compare the difference. I'm now working on a more complete GUI frontend for rec2lamegui, which should be availabe in the not too distant future... :-)

# rec2lamegui-0.4.pet
# Dotpet of Program: rec2lamegui Revision 0.4 23Sept2007
# Record audio from your soundcard straight to mp3 without any need for an intermediate wav file.
# Programmer: William McEwan (mcewanw)

This dotpet automatically adds the following files to your system:

/usr/local/bin/rec2lamegui
/usr/local/share/doc/rec2lamegui/
/usr/local/share/doc/rec2lamegui/rec2lamegui-0.4readme.txt

It also creates an icon (mini-sound.xpm) and JWM menu item in JWM > Multimedia > rec2lamegui sound recorder, storing this desktop info in /usr/share/applications

The utility registers with PETget so that you can easily uninstall it if you wish.

----------------------

I've never before programmed with Xdialog/gtkdialog stuff, and don't even know the name of the language(!). However, I managed to create this utiliy by first examining the scripts /usr/local/apps/Soxgui/soxexec and /usr/local/apps/Soxgui/main and by then doing a bit of reverse engineering... (i.e. I stole bits of code and modified it...).

The result is a simple, albeit rough, gui frontend for the commandline mechanism for recording direct to mp3:

rec -c 1 -t raw -f sw -r 44100 - | lame -r -x -s 44.1 -m m -h --abr 8 --nspsytune --lowpass 7 - out.mp3 &
[Thanks Lobster for help with the lame parameter settings]

This script is unpolished, and should be considered as no more than a fully-working starting point for a more robust gui frontend. I also think it is a nice simple illustration of how easy it is to script gui apps in Puppy Linux. Remember, I don't know this particular programming language (though this wee script is quite easy to understand), so I don't guarantee it at all; however, it works for me! :-)

You should, of course, check that your sound source (e.g. a microphone) is working correctly beforehand. Personally, I usually run JWM > Multimedia > Puppy sound mixer, in order to check that the settings are correct, before running any audio programs.

Should you want to improve the sound, you might like to try manually altering the installed script. That is, open the script /usr/local/bin/rec2lamegui in any text editor and play with the parameters for lame and rec on the line:

rec -c 1 -t raw -f sw -r 44100 - | lame -r -x -s 44.1 -m m -h --abr 8 --nspsytune --lowpass 7 - $DIR$myfile &

Remember, if you "break" it, no problem, you can uninstall it and reinstall it again via PETget. However, usage of this utility is entirely at your own risk! :-)

You can also change the default directory for storing your recordings by editing /usr/local/bin/rec2lamegui and changing the line: defaultdirectory=~/my-documents

Feel free to improve the program, but let me know of what changes you make so that I can upload the improved version as a dotpet on this thread.

Here is the code for your perusal, followed for your convenience by the uploaded script itself:

Code: Select all

#!/bin/sh
# Program rec2lamegui  Revision 0.4 23Sept2007
# Programmer: William McEwan (mcewanw)

version=0.4

# Where the save to directory selection window begins
defaultdirectory=~/my-documents

#The following few lines are the Xdialog stuff
myfile=`Xdialog --title "rec2lamegui"-$version --inputbox "Enter a filename for your recording" 0 0 2>&1`'.mp3'
[ $myfile = "".mp3 ] && exit 0

DIR=`Xdialog --title "Select your output directory" --dselect $defaultdirectory 0 0 2>&1`
case $? in
  1)
    echo "Cancel pressed." && exit 0;;
esac

# The following is the line that does the actual recording to mp3
rec -c 1 -t raw -f sw -r 44100 - | lame -r -x -s 44.1 -m m -h --abr 8 --nspsytune --lowpass 7 - $DIR$myfile & 

# The following is the gtkdialog stuff
export MAIN_DIALOG="
	<window title=\"rec2lamegui \"icon-name=\"gtk-cdrom\">
		<vbox>
       		<hbox>
      			<button>
        			<label>Click Here to Stop Recording</label>
        			<action type=\"exit\">EXIT-NOW</action>
      			</button>
       		</hbox>
  		</vbox>
  	</window>
	"
	MAIN_DIALOG="`gtkdialog3 --program=MAIN_DIALOG --center`"

	if [ "`echo "$MAIN_DIALOG" | grep EXIT-NOW`" != "" ]; then
		echo Quit button pushed
		# make sure you put exactly one space after lame below
		PROCESS=`ps aux | grep 'lame ' | sed -n 1p | sed 's/^[ \t]*//' | cut -f 1 -d ' '`
		kill -TERM "$PROCESS"
		exit 0
	fi
md5sums for the files below:

c7192c9255263ee94f209776fe099110 rec2lamegui-0.4.pet [the best one!]

5826e3d8fda33fbf41bb47cfac6babd9 arecord2lamegui-0.4.pet
Attachments
rec2lamegui-0.4.pet
Small fix to the dotpet so that JWM menu selection works now
(2.48 KiB) Downloaded 462 times
arecord2lamegui-0.4.pet
Version 0.4 produces smaller, better quality mp3's than version 0.2 did. The code is also tidied up a bit...
(2.78 KiB) Downloaded 502 times
Last edited by mcewanw on Thu 04 Oct 2007, 03:55, edited 22 times in total.

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#17 Post by Lobster »

it works for me!
:)

worked for me too.
Do you get crackles in the recording?
. . . might be my mic

Is there a way to cut the sample rate further (to about a third of the present)?

Very simple very usable - hope you keep working on it.

Great stuff :)

can this

Code: Select all

myfile=`Xdialog --inputbox "Enter record filename (e.g. voice.mp3)" 0 0 2>&1` 
be changed to something like

Code: Select all

myfile=`Xdialog --inputbox "Enter record filename" 0 0 2>&1` + '.mp3'
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

minor alterations plus PetGET registered dotpet coming

#18 Post by mcewanw »

Lobster wrote:worked for me too.
Do you get crackles in the recording?
. . . might be my mic
I have a hopeless mic, so I can't tell. But, yes, probably need to adjust the lame parameters.
Lobster wrote: Is there a way to cut the sample rate further (to about a third of the present)?
I don't know anything about adjusting sample rate with arecord or lame. Remember, I just threw this together! For the moment, I suggest you just open the script /usr/local/bin/arecord2lamegui in a text editor and adjust the following line manually until it suits you:

arecord -f cd -t raw | lame -a -h -b 24 --nspsytune --resample 22 --lowpass 7 -x - $DIR$myfile &
Lobster wrote: can this

Code: Select all

myfile=`Xdialog --inputbox "Enter record filename (e.g. voice.mp3)" 0 0 2>&1` 
be changed to something like

Code: Select all

myfile=`Xdialog --inputbox "Enter record filename" 0 0 2>&1` + '.mp3'
I'll give that a quick try. I'm about to post a dotpet up for convenience; easier to remove and puts a menu item under JWM > Multimedia

Won't be doing any more changes for a while apart from the above file dialog change try though (need to sleep and behind with things I'm supposed to be doing at home!...).[/quote]

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

it is now a dotpet...

#19 Post by mcewanw »

Lobster wrote:Very simple very usable - hope you keep working on it.
Okay, I made the one alteration (auto .mp3 extension) as you suggested.

I've now edited my original text about it and uploaded it there as a dotpet (i.e. find it in my earlier post above along with an md5sum). Hope you manage to manually adjust the sound quality to your satisfaction. Let me know what you do please and I'll reload any improved dotpet later.

Actually, even if the program is now improved, I'll leave the above simple version pretty much as it is (apart from any discovered audio quality/sample rate improvements) because I think it's an easy to understand illustration of how to write this kind of code. It's always good to encourage others to have a go at coding! :-)

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

Now I know what "Xdialog" is...

#20 Post by mcewanw »

Okay, I've now looked it up on the net and found out what Xdialog is; talk about putting the cart before the horse... :-)

http://xdialog.dyns.net/

Like with most commands, one can also find (very) brief usage instructions by opening an rxvt console and entering:

Xdialog --help

or, for a bit more detail usually:

man Xdialog

Very detailed online documentation can be found at:

http://thgodef.nerim.net/xdialog/doc/index.html
---------
gtkdialog is another piece in the puzzle. Homepage:

http://linux.pte.hu/~pipas/gtkdialog/
[Some good gtkdialog coding examples at the above site]

gtkdialog3 --help

for simple usage.

man gtkdialog3

provides a popup readme file for Puppy users.

It is quite easy really. Just need to start using it!
------------------------

There seems to be some duplicate functionality between the Xdialog coding methodology and the gtkdialog one. I suspect you don't really need to mix them (but I might be wrong about that); I'm sure they both have their individual advantages and disadvantages though. Presumably, gtkdialog provides a gtk look and feel? Anyway, the Soxgui scripts use both, thus so have I, for the moment, in my arecord2lamegui script.

Post Reply