Sponsored Content
Top Forums Shell Programming and Scripting Error with Audio Conversion Bash Script Post 302701405 by Corona688 on Sunday 16th of September 2012 12:28:59 AM
Old 09-16-2012
-f takes one string, not zero or two or more.

I'd try it like this:

Code:
for f in *.m4a
do
    [ -f "$f" ] || break
    [ -z "$BITRATE" ] && read -p "Input bitrate" bitrate

    avconv -i "$f" -b "$bitrate"k "${f%.m4a}.mp3"
done

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Conversion of bash parsing script to perl?

I need help with a perl parsing script. I have some error logs on a windows machine that I need to parse from a text file, but I know nothing about perl. I usually run this bash script on my linux box and it does just what I need. How would I do the same thing with perl and port it to my windows... (2 Replies)
Discussion started by: cstovall
2 Replies

2. UNIX for Dummies Questions & Answers

Another bash shell to perl conversion

Hello everyone. I am new to linux and need help again. I need help converting this bash shell to linux: for i in `ls -l *.txt` do `./cnvidtf.pl $i` `curl -u login:pswd --disable-espv -T loadfile.seq ftp://11.1.11.1` `mysql -u login -h 11.1.11.1 -ppswd < lddocs.sql` done Thanks! Any help... (6 Replies)
Discussion started by: freak
6 Replies

3. UNIX for Dummies Questions & Answers

BASH uppercase conversion

How can I convert a variable to uppercase like ksh, typeset -u $1 in bash? (1 Reply)
Discussion started by: stringdom
1 Replies

4. Shell Programming and Scripting

Typeset conversion problem from ksh to bash

Hi, typeset -l sgf # all lowercase letters typeset -u SGF # all uppercase letters sgf=$1 SGF=$sgf these lines used in my scripts . It ran fine in ksh but when we convert this to bash it erroring out. I like to know what the use of typeset ?? Thanks & Regards kanagaraj (3 Replies)
Discussion started by: kanagaraj
3 Replies

5. Shell Programming and Scripting

Bash to sh conversion

declare -i DEFINT=1 declare -i DEFDELAY=1 declare -i timeout=DEFTOUT declare -i interval=DEFINT declare -i delay=DEFDELAY if (($# == 0 || interval <= 0)); then printUsage exit 1 fi ( ((t = timeout)) while ((t > 0)); do sleep $interval kill -0 $$ ||... (5 Replies)
Discussion started by: SkySmart
5 Replies

6. Shell Programming and Scripting

Batch to bash conversion

Hi, I am just trying to convert the batch script to bash script and i am stuck at one point where I have the below code for /f "delims=" %%a in (a.txt) do ( for /f "tokens=1,2,3* delims==" %%i in ("%%a") do ( for /f "tokens=1,2,3* delims= " %%x in ("%%i") do ( if... (4 Replies)
Discussion started by: prasanna2166
4 Replies

7. Slackware

Problems with audio recording in Audacity 2.0.5. Slackware64 14.1; Intel HD Audio.

I'm trying to record audio using Audacity 2.0.5 installed from SlackBuilds. My system is 64-bit Slackware 14.1 and a sound card is Intel HD Audio. I didn't change my sound system to OSS. (Default sound system in Slackware 14.1 is ALSA, isn't it?) First, I set Internal Microphone slider in KMix... (2 Replies)
Discussion started by: qzxcvbnm
2 Replies

8. OS X (Apple)

A Bash Audio Sweep Generator...

This is a small program as a tester for a basic sweep generator for bandwidth testing of AudioScope.sh. This DEMO is only capable of 4KHz down to about 85Hz and back due to the low bit rate, but it is proof of concept for a much wider variant using a much higher bit rate. The file generated... (4 Replies)
Discussion started by: wisecracker
4 Replies

9. Shell Programming and Scripting

Bash Scripting with date format conversion

I have a script below and wanted to change the output into three different file format (3 separate script) #!bin/bash #input file format postwrf_d01_20131206_0600_f08400.grb2 #postwrf_d01_YYYYMMDD_ZZZZ_f0HHHH.grb2 #zzzz= 0000,0600,1200,1800 (in UTC) #HHHH=00000,00600,01200,01800 ..ect (in... (1 Reply)
Discussion started by: cumulus_255
1 Replies
pods::SDL::AudioCVT(3pm)				User Contributed Perl Documentation				  pods::SDL::AudioCVT(3pm)

NAME
SDL::AudioCVT -- Audio Conversion Structure CATEGORY
Core, Audio, Structure SYNOPSIS
DESCRIPTION
The "SDL::AudioCVT" is used to convert audio data between different formats. A "SDL::AudioCVT" structure is created with the "SDL::AudioCVT-"build> function, while the actual conversion is done by the "SDL::Audio::convert_audio" function. METHODS
new This constructor returns an empty "SDL::AudioCVT" structure. build $cvt = SDL::AudioCVT->build( $src_format, $src_channels, $src_rate $dst_format, $dst_channels, $dst_rate ); Before an "SDL::AudioCVT" structure can be used to convert audio data it must be initialized with source and destination information. "src_format" and "dst_format" are the source and destination format of the conversion. (For information on audio formats see "SDL::AudioSpec"). "src_channels" and "dst_channels" are the number of channels in the source and destination formats. Finally, "src_rate" and "dst_rate" are the frequency or samples-per-second of the source and destination formats. Once again, see "SDL::AudioSpec". Currently (SDL-1.2.11) only rate conversions of 2x and (1/2)x with x > 0 are done, nearing the requested rate conversion. See "SDL::Audio::convert_audio". needed Set to one if the conversion is possible src_format Audio format of the source dest_format Audio format of the destination rate_incr Rate conversion increment len Length of the original audio buffer in bytes len_cvt Length of converted audio buffer in bytes (calculated) len_mult "buf" must be "len*len_mult" bytes in size (calculated) len_ratio Final audio size is "len*len_ratio" AUTHORS
See "AUTHORS" in SDL. perl v5.14.2 2012-05-28 pods::SDL::AudioCVT(3pm)
All times are GMT -4. The time now is 04:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy