Sponsored Content
Full Discussion: Play sound
Top Forums Shell Programming and Scripting Play sound Post 302787053 by Corona688 on Thursday 28th of March 2013 03:39:59 PM
Old 03-28-2013
I suppose a brutally simple way would just be a loop:

Code:
tr '[A-Z]' '[a-z]' < inputfile | while read LINE
do
        STR=""
        set -- $LINE
        while [ "$#" -gt 0 ]
        do
                [ -f "wavdir/$1.wav" ] && STR="$STR wavdir/$1.wav"
                shift
        done

        [ ! -z "$STR" ] && play $STR
done

It converts all uppercase into lowercase, then reads every line, splits words on whitespace into $1 $2 ..., loops over $1...$N, and for every word matching a file inside wavdir/, adds it to a list of files to be played then plays it.

You need sox's play command for this...
This User Gave Thanks to Corona688 For This Post:
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

play cd? how?

hi all, How do I set up my cdrom to play some regular audio cd (not cd-r or cd-rw). I know that my cdrom has been mounted as it does pop up the file manager if I put in, e.g., the office52 cd. Thanks in advance. Andre (3 Replies)
Discussion started by: andrec
3 Replies

2. UNIX for Advanced & Expert Users

Need something new to play with

I posted this question in the dummies forums, but I would like to get a more expert opinion... I am looking for a new OS to play with. I have a celron 450 running slackware linux, a powermac G4 450 running Mac OS X (Which by the way has 81 days of uptime as of this moment), a PowerBook G3 running... (5 Replies)
Discussion started by: dewhite04
5 Replies

3. UNIX for Dummies Questions & Answers

How Can I Play A Cd On Unix

HI I AM A FRESH NEW USER ...I MEAN I JUST GOT A COMPUTER ALMOST FOR FREE AND IT RUNS UNIX WHICH I DIDN'T EXPECT AND DONT KNOW HOW TO WORK ON IT I THOUGHT IT'LL BE WITH WINDOWS ..YOU KNOW SO HOW DO I PLAY A CD IN IT. REMEMBER I KNOW NOTHING ABOUT UNIX , BUT I THINK I'LL GET OVER IT... (1 Reply)
Discussion started by: IMOTEB
1 Replies

4. UNIX for Advanced & Expert Users

play

dear friends, i have linux system . can i play songs in linux system. like winamp player in windows. let me know. (2 Replies)
Discussion started by: rajan_ka1
2 Replies

5. Linux

how can i play the gam

can some1 tell me how to start playing? (2 Replies)
Discussion started by: 123456
2 Replies

6. Linux

Can not play sound in Linux RHEL5.

Hi All, Recently I installed Linux RHEL5 on my machine. It seems that I can not play sound on RHEL5. I have real player installed along with RHEL5 but, when I try to play any song, the error message comes up saying "Can not open the audio device.Another application may be using it." Does any... (2 Replies)
Discussion started by: gydave
2 Replies

7. Slackware

Can't play sound files with aplay or cat to /dev/dsp

I am having problems using soundes. Until a few moments ago the following commands produced errors and no sound: cat /usr/share/apps/kolf/sounds/blackhole.wav/ > /dev/dsp yielded: /dev/dsp: Invalid argument cat /usr/share/apps/kolf/sounds/blackhole.wav > /dev/audio yelded: /dev/audio:... (3 Replies)
Discussion started by: slak0
3 Replies

8. Shell Programming and Scripting

Making a play-list

approximately the same question as the last time, but unfortunately I didn't get a working answer. I made a script with bash and gtkdialog that create a play-list. The output is for example : gtk-media-pause | CB60471-05 - Gilbert, Brantley - Country Must Be Country Wide.zip | 28897 |... (3 Replies)
Discussion started by: jkfloris
3 Replies
SUMO(1) 							   User Commands							   SUMO(1)

NAME
SUMO - Importer of O/D-matrices for the road traffic simulation SUMO SYNOPSIS
od2trips [OPTION]* DESCRIPTION
SUMO od2trips Version 0.15.0 Copyright (C) 2001-2012 DLR and contributors; http://sumo.sourceforge.net Importer of O/D-matrices for the road traffic simulation SUMO. Configuration Options: -c, --configuration-file FILE Loads the named config on startup --save-configuration FILE Saves current configuration into FILE --save-template FILE Saves a configuration template (empty) into FILE --save-schema FILE Saves the configuration schema into FILE --save-commented Adds comments to saved template, configuration, or schema Input Options: -n, --net-file FILE Loads network (districts) from FILE -d, --od-matrix-files FILE Loads O/D-files from FILE(s) Output Options: -o, --output-file FILE Writes trip definitions into FILE --ignore-vehicle-type Does not save vtype information Time Options: -b, --begin TIME Defines the begin time; Previous trips will be discarded -e, --end TIME Defines the end time; Later trips will be discarded; Defaults to the maximum time that SUMO can represent Processing Options: -s, --scale FLOAT Scales the loaded flows by FLOAT --spread.uniform Spreads trips uniformly over each time period --vtype STR Defines the name of the vehicle type to use --prefix STR Defines the prefix for vehicle names --timeline STR Uses STR as a timeline definition --timeline.day-in-hours Uses STR as a 24h-timeline definition --dismiss-loading-errors Continue on broken input --no-step-log Disable console output of current time step Defaults Options: --departlane STR Assigns a default depart lane --departpos STR Assigns a default depart position --departspeed STR Assigns a default depart speed --arrivallane STR Assigns a default arrival lane --arrivalpos STR Assigns a default arrival position --arrivalspeed STR Assigns a default arrival speed Report Options: -v, --verbose Switches to verbose output -p, --print-options Prints option values before processing -?, --help Prints this screen -V, --version Prints the current version -W, --no-warnings Disables output of warnings -l, --log FILE Writes all messages to FILE (implies verbose) --message-log FILE Writes all non-error messages to FILE (implies verbose) --error-log FILE Writes all warnings and errors to FILE Random Number Options: --random Initialises the random number generator with the current system time --seed INT Initialises the random number generator with the given value EXAMPLES
od2trips -c <CONFIGURATION> run with configuration file REPORTING BUGS
Report bugs at <http://sourceforge.net/apps/trac/sumo/>. Get in contact via <sumo-user@lists.sourceforge.net>. Copyright (C) 2001-2012 DLR and contributors; http://sumo.sourceforge.net SUMO od2trips Version 0.15.0 is part of SUMO. SUMO is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/gpl.html SUMO od2trips Version 0.15.0 May 2012 SUMO(1)
All times are GMT -4. The time now is 08:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy