LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-01-2012, 10:52 AM   #1
Ian D
Member
 
Registered: Aug 2005
Location: Solihull, UK
Distribution: Fedora 39
Posts: 215

Rep: Reputation: 18
arecord displaying VU meter from a script


I have discovered arecord which, for the time being, enables me to record audio, triggered by a command line.

I notice that arecord will display a primitive VU meter: When you type "arecord -V stereo" (plus some other options), you get some activity on the next line in the terminal window. I also get other output in the window which confirms the file name which is being created.

I wrote a script which calls on arecord - so that I don't need to put in all the options manually. When I run the script, I still get the file name displayed - but I don't get the VU meter. Where might it be hiding?

EDIT. I thought I should include a (simplified) sample of the script I want to use
Quote:
#!/bin/bash
echo "Running Script"
echo "To test by hand, type"
echo "arecord -V stereo -f cd byHand.wav"
FileName="${HOME}/byScript.wav"
echo "Filename=${FileName}"
sh `arecord -V "stereo" -f "cd" "${Filename}"`
However, this script is even worse that the real one - the filename does not make it through correctly.
So, now I have two questions - where does the VU Meter go and what am I doing wrong with the quotes in my script?

Last edited by Ian D; 11-01-2012 at 12:15 PM. Reason: Extra information
 
Old 11-12-2012, 07:03 AM   #2
elucches
Member
 
Registered: Jan 2011
Posts: 108

Rep: Reputation: 11
Hello Ian,
Do you need to launch another shell for arecord? I wrote a script with a line like this one:
arecord -V stereo -f cd removeme
and the volume bar is shown in the terminal from which it is called. In that case you only need to quote the file name. Do you need to use curly brackets? I always used "$var" only (http://www.tldp.org/LDP/abs/html/index.html)
Best regards,
Esteban
 
Old 11-12-2012, 07:16 AM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
sh `arecord -V "stereo" -f "cd" "${Filename}"` looks strange. It generates a command of sh followed by the output of the command between the ` characters.

Probably you just want arecord -V "stereo" -f "cd" "$Filename" (the { } are not wrong but not required either).
 
Old 11-24-2012, 07:39 AM   #4
Ian D
Member
 
Registered: Aug 2005
Location: Solihull, UK
Distribution: Fedora 39
Posts: 215

Original Poster
Rep: Reputation: 18
Thank you both. The script (and arecord) now does what I wanted it to.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell script - displaying multiple variables mobarger Linux - General 6 10-19-2016 08:56 PM
[SOLVED] avoid displaying errors while executing a script vikas027 Programming 4 10-31-2007 01:27 AM
Site Meter, Inc. java script mikieboy Linux - Security 2 12-01-2006 01:45 PM
bash script for displaying a file one line at a time. panchosansa Programming 6 10-12-2006 10:54 AM
Script for displaying cal in translucent eterm debiant Linux - Newbie 3 08-19-2006 03:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration