Re: Record Audio in Rev on Linux OS?
Invoking the shell command is the easy part. First, you open a terminal and verify that the command or script you want to use works properly from the terminal. For example, if you are going to use krecord you would open a terminal and do krec followed by whatever options you want. (this seems to be the command which opens the app now, seems to me it used to be krecord but still.) Now you know that it works as expected in the shell, you can invoke it from Rev: put shell(krec) -- this will just open the application. For instance, to execute the command you gave as a sample, from a button, you would just do: on mouseUp put shell(arecord -d 10 -f cd -t wav -D copy foobar.wav) end mouseUp This would then record the file in the user's home directory as foobar.wav. You can execute any shell command like this. You can also pipe the output of one shell command to the input of another one, in a shell command, as in ls | gedit this will have the effect of first listing the current directory contents, then sending the result to gedit, in which the input will be opened. You could use this to send a file, once recorded, to a player. Or, if you have lame installed, you could use it to convert the file to mp3 with soundconverter. Finally, you might need to execute commands one after the other, which you can also do. To do this, you put your script into a file, for example, myscript.sh, have the first line be a so called 'shebang', make it executable, and put in your commands one after the other. Lets say you wanted the file in the above example to go to the desktop: #! /usr/bin/env bash cd Desktop arecord -d 10 -f cd -t wav -D copy foobar.wav Now you would do, from your button, put shell (myscript.sh) -- the file would have to be made executable. The shell is a quite fully featured, if rather antique, programming language, with what you might regard as a huge collection of macros and utilities for all kinds of purposes. Most of the stuff you would expect, flow control, branching, error reporting etc. There are lots of guides to it on the net, but if you're in an academic environment the simplest might be to find someone in IT who has scripting experience and have them write it. If you want to learn it yourself, there is a nice book, full of worked examples, by Glen Smith: Introduction to Shell Scripting. Might be a bit basic for an experienced programmer. It is antique, but its ideal for this sort of thing, because of the ability to invoke stuff like krec. On Rev, because of the limitations of Rev on Linux at the moment, its a lifesaver. Peter -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/Record-Audio-in-Rev-on-Linux-OS-tp2016409p2032844.html Sent from the Revolution - User mailing list archive at Nabble.com. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Record Audio in Rev on Linux OS?
Sorry, deeply embarrassing, of course what you need to do is not ls | gedit but first redirect the ls output to a file, and then redirect this file to gedit, as in ls test.txt | gedit The is a way of sending the output of the command to the file instead of to the terminal. Then the | operator sends it to gedit, which opens with it. At least, I hope it does! Quick, someone who knows about this stuff join in! Peter -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/Record-Audio-in-Rev-on-Linux-OS-tp2016409p2062546.html Sent from the Revolution - User mailing list archive at Nabble.com. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
RunRev and Linux Shell Scripting (...was Re: Record Audio in Rev on Linux OS?)
Thanks Peter!!! This was just the information I was looking for! John Patten Date: Thu, 22 Apr 2010 23:39:17 -0800 (PST) From: Peter Alcibiades palcibiades-fi...@yahoo.co.uk Subject: Re: Record Audio in Rev on Linux OS? To: use-revolution@lists.runrev.com Message-ID: 1272008357927-2032844.p...@n4.nabble.com Content-Type: text/plain; charset=us-ascii Invoking the shell command is the easy part. First, you open a terminal and verify that the command or script you want to use works properly from the terminal. For example, if you are going to use krecord you would open a terminal and do krec followed by whatever options you want. (this seems to be the command which opens the app now, seems to me it used to be krecord but still.) Now you know that it works as expected in the shell, you can invoke it from Rev: put shell(krec) -- this will just open the application. For instance, to execute the command you gave as a sample, from a button, you would just do: on mouseUp put shell(arecord -d 10 -f cd -t wav -D copy foobar.wav) end mouseUp This would then record the file in the user's home directory as foobar.wav. You can execute any shell command like this. You can also pipe the output of one shell command to the input of another one, in a shell command, as in ls | gedit this will have the effect of first listing the current directory contents, then sending the result to gedit, in which the input will be opened. You could use this to send a file, once recorded, to a player. Or, if you have lame installed, you could use it to convert the file to mp3 with soundconverter. Finally, you might need to execute commands one after the other, which you can also do. To do this, you put your script into a file, for example, myscript.sh, have the first line be a so called 'shebang', make it executable, and put in your commands one after the other. Lets say you wanted the file in the above example to go to the desktop: #! /usr/bin/env bash cd Desktop arecord -d 10 -f cd -t wav -D copy foobar.wav Now you would do, from your button, put shell (myscript.sh) -- the file would have to be made executable. The shell is a quite fully featured, if rather antique, programming language, with what you might regard as a huge collection of macros and utilities for all kinds of purposes. Most of the stuff you would expect, flow control, branching, error reporting etc. There are lots of guides to it on the net, but if you're in an academic environment the simplest might be to find someone in IT who has scripting experience and have them write it. If you want to learn it yourself, there is a nice book, full of worked examples, by Glen Smith: Introduction to Shell Scripting. Might be a bit basic for an experienced programmer. It is antique, but its ideal for this sort of thing, because of the ability to invoke stuff like krec. On Rev, because of the limitations of Rev on Linux at the moment, its a lifesaver. Peter -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/Record-Audio-in-Rev-on-Linux-OS-tp2016409p2032844.html Sent from the Revolution - User mailing list archive at Nabble.com. -- ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Record Audio in Rev on Linux OS?
Thanks for the suggestion Peter! As for how to go about doing what you described in Linux, I'm at a loss. I have no experience using Rev and Shell scripts in Linux. The reason why I am interested is that I working on a little utility that allows students to record an audio response and then ftp the resulting audio file to a server. This works fine on my Mac, and I presume it will on Windows too (though have not tested extensively yet). We have recently begun using Netbooks running Ubuntu Remix with our students (about 600 of them currently). We do have Audacity on them for recording audio, among a whole collection of other great software tools. I would like to be able to get my little utility to work on the Netbooks too. I have looked up krecord and hunted some discussion lists related to command line commands for this tool. I don't see too much in the area of command line language for Audacity, so I'm guessing we will have to use krecord or ALSA. These laptops do have ALSA arecord and aplay and I do see an example in man for arecord: arecord -d 10 -f cd -t wav -D copy foobar.wav (I'm guessing in the example above, I would need to give the complete path when saving the foobar.wav file. Something like ~/home/student/ foobar.wav ) I have never done anything like this with Rev before and need some direction. I'm guessing that I'm going to need to create a function that will contain the shell script and then call it from a button when I want to record...? But I don't have a clue what it would look like??? Does someone have a simple example stack I can pick apart? Thank you! John Patten -- Message: 11 Date: Mon, 19 Apr 2010 12:45:13 -0800 (PST) From: Peter Alcibiades palcibiades-fi...@yahoo.co.uk Subject: Re: Record Audio in Rev on Linux OS? To: use-revolution@lists.runrev.com Message-ID: 1271709913251-2016534.p...@n4.nabble.com Content-Type: text/plain; charset=us-ascii Dunno about Rev directly, but you can go out to shell, and then use the Linux command line tools. The easiest gui recording tool is krecord, but there are lots of non-gui ones. Use zenity to get a gui for them. Then when you've captured the file, go out to the shell again to play it. Or maybe this is what you were trying to avoid? Most things that Rev cannot do can be done in the shell. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Record Audio in Rev on Linux OS?
Hi All... I think I know the answer, but want to make sure. Is is possible to record audio in a stack that is running on Linux (Ubuntu)? Thank you! John Patten ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Record Audio in Rev on Linux OS?
Dunno about Rev directly, but you can go out to shell, and then use the Linux command line tools. The easiest gui recording tool is krecord, but there are lots of non-gui ones. Use zenity to get a gui for them. Then when you've captured the file, go out to the shell again to play it. Or maybe this is what you were trying to avoid? Most things that Rev cannot do can be done in the shell. -- View this message in context: http://n4.nabble.com/Record-Audio-in-Rev-on-Linux-OS-tp2016409p2016534.html Sent from the Revolution - User mailing list archive at Nabble.com. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Record Audio in Rev on Linux OS?
On Mon Apr 19 15:45:13 CDT 2010 Peter Alcibiades wrote: Dunno about Rev directly, but you can go out to shell, and then use the Linux command line tools. The easiest gui recording tool is krecord, but there are lots of non-gui ones. Use zenity to get a gui for them. Then when you've captured the file, go out to the shell again to play it. Or maybe this is what you were trying to avoid? Most things that Rev cannot do can be done in the shell. In Windows, i use SoX (Sound eXchange): http://sox.sourceforge.net/ This utility works great! :-) But i am curious to know if, in Linux, Rev could use and control command line utilities like SoX. Some years ago, i created a GUI for the command line utility Potrace and the only problem that i found was the limitation in pixels of images imported into Rev: http://quality.runrev.com/qacenter/show_bug.cgi?id=2429 Everything else, worked fine: http://capellan2000.000space.com/Potrace_Interface1.jpg http://capellan2000.000space.com/Potrace_Interface2.jpg http://capellan2000.000space.com/Potrace_Interface3.jpg Alejandro ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution