Visit Our UNIX and Linux User Community


Generate 10000 unique audio file of 2MB each using shell script.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Generate 10000 unique audio file of 2MB each using shell script.
# 1  
Old 09-25-2015
RedHat Generate 10000 unique audio file of 2MB each using shell script.

Hi,

I want 10000+ unique Audio file of approx 2MB each. How can i generate numerous audio files using shell script. Any tool, command or suggestions are welcome.

If i give one audio seed file then can we create numerous unique files with same seed file?

Any help is highly appreciable. Thanks in advance.

Regards,
Sushil Kumar
# 2  
Old 09-25-2015
Eh?

!0000 audio files?

In what format, RAW, WAVE, etc?
Pure waveforms, various noises for bandpass tests, voice, music, etc?
What audio bandwidth, (in other words what sampling rates)?
Stereo, mono, multichannel, etc?
Digitally and/or analogue compressed or not?
Which interpolation, assuming that computer sound systems can have interpolation switched from the command line?
Two tone test frequencies with known fixed output levels?

I could go on but these are enough for you to go and do some research...
This User Gave Thanks to wisecracker For This Post:
# 3  
Old 09-25-2015
Thanks for reply,
I do not bother about audio quality of these files as it is not in scope.

* Any audio file format either raw, wav, AIFF, MP3 etc. is fine.
* Any type of audio either voice, music, noise or bandpass tests.
* Sampling rates should be between 44.1kHz or 48kHz.
* It can be anything among Stereo, mono, multichannel, etc?
* Anything either digitally and/or analogue compressed or not?

I need to use these file to testing software with unique file every time at unix command line so do not bother to listen any file. My requirement is to have almost same size audio file(10% +- is file size).

Regards,
Sushil Kumar
# 4  
Old 09-25-2015
Here you go two 2MiB raw 8 bit files inside the /tmp/ directory...
Longhand OSX 10.7.5, default bash terminal...
Code:
Last login: Fri Sep 25 18:13:54 on ttys000
AMIGA:barrywalker~> n=1
AMIGA:barrywalker~> dd if=/dev/urandom of=/tmp/audio$n.raw bs=65536 count=32
32+0 records in
32+0 records out
2097152 bytes transferred in 0.139460 secs (15037650 bytes/sec)
AMIGA:barrywalker~> ls -l /tmp/
total 4096
-rw-r--r--  1 barrywalker  wheel  2097152 25 Sep 18:19 audio1.raw
drwx------  3 barrywalker  wheel      102 25 Sep 17:59 launch-3cbyC8
drwx------  3 barrywalker  wheel      102 25 Sep 17:59 launch-AW6HFF
drwx------  3 barrywalker  wheel      102 25 Sep 17:59 launch-tIudW3
drwx------  3 barrywalker  wheel      102 25 Sep 17:59 launch-vbq4iY
drwx------  3 barrywalker  wheel      102 25 Sep 17:59 launchd-115.cw4TfC
drwx------  3 _spotlight   wheel      102 25 Sep 18:14 launchd-204.CisNkR
AMIGA:barrywalker~> n=2
AMIGA:barrywalker~> dd if=/dev/urandom of=/tmp/audio$n.raw bs=65536 count=32
32+0 records in
32+0 records out
2097152 bytes transferred in 0.137951 secs (15202137 bytes/sec)
AMIGA:barrywalker~> ls -l /tmp/
total 8192
-rw-r--r--  1 barrywalker  wheel  2097152 25 Sep 18:19 audio1.raw
-rw-r--r--  1 barrywalker  wheel  2097152 25 Sep 18:23 audio2.raw
drwx------  3 barrywalker  wheel      102 25 Sep 17:59 launch-3cbyC8
drwx------  3 barrywalker  wheel      102 25 Sep 17:59 launch-AW6HFF
drwx------  3 barrywalker  wheel      102 25 Sep 17:59 launch-tIudW3
drwx------  3 barrywalker  wheel      102 25 Sep 17:59 launch-vbq4iY
drwx------  3 barrywalker  wheel      102 25 Sep 17:59 launchd-115.cw4TfC
drwx------  3 _spotlight   wheel      102 25 Sep 18:14 launchd-204.CisNkR
AMIGA:barrywalker~> _

I have no idea what kind of disk thrashing would occur with 20GiB worth of junk data being written to it, nor how long it would take, HOWEVER......
You use this method at your own risk and myself this site hold no responsibility for any adverse effects using this method...
# 5  
Old 09-28-2015
Thanks for your prompt reply,

I have created 4 sample ".raw" file with n={1,2,3,4} at my unix box and copy it using winscp to windows machine. i tried to listen the ".raw" file but it is not audible. I used vlc media player to listen the ".raw" file.

suk@pabet-xmdevc105:~/audio$ ls -ltr
total 8192
-rw-r--r-- 1 root root 2097152 Sep 28 09:51 audio1.raw
-rw-r--r-- 1 root root 2097152 Sep 28 09:51 audio2.raw
-rw-r--r-- 1 root root 2097152 Sep 28 09:51 audio3.raw
-rw-r--r-- 1 root root 2097152 Sep 28 09:51 audio4.raw

Is their anything i have to do to make it audible. I just want to make sure the file is "audio" file.

With Thanks & Regards,
Sushil Kumar
# 6  
Old 09-28-2015
Do you have e.g. aplay on your *nix machine? What happens if you aplay audio1.raw?
# 7  
Old 09-28-2015
Hi RudiC,
I only use terminal@Ubuntu Linux Virtual Machine. I tried to run at the terminal and it showed "Playing raw data 'audio1.raw' : Unsigned 8 bit, Rate 8000 Hz, Mono" as output.

suk@pabet-xmdevc105:~/audio$ aplay audio1.raw
Playing raw data 'audio1.raw' : Unsigned 8 bit, Rate 8000 Hz, Mono

Can i winscp and hear these audio files with any other audio player at windows machine if not "VLC Media player"

Regards,
Sushil kumar

Previous Thread | Next Thread
Test Your Knowledge in Computers #579
Difficulty: Easy
A string is a disordered sequence of characters.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Shell script newbie- how to generate service log from shell script

Hi, I am totally a newbie to any programming languages and I just started an entry level job in an IT company. One of my recent tasks is to create a script that is able to show the log file of linux service (i.e. ntpd service) lets say, if I run my script ./test.sh, the output should be... (3 Replies)
Discussion started by: xiaogeji
3 Replies

2. Shell Programming and Scripting

Parameterizing to dynamically generate the extract file from Oracle table using Shell Script

I have below 2 requirements for parameterize the generate the extract file from Oracle table using Shell Script. Could you please help me by modifying the script and show me how to execute it. First Requirement: I have a requirement where I need to parameterize to generate one... (0 Replies)
Discussion started by: hareshvikram
0 Replies

3. Shell Programming and Scripting

Shell script to compare and generate a new file

Requirement is I have two files their format is File1 - input_file ----- tmp_value|3|number|| tmp_value1|3|alpha|| tmp_value2|6|alpha|AA AA| tmp_value3|15|number|000000005| tmp_value4|15|number|000000000000000| tmp_value5|11|alpha|bbbbbbbbbbb| tmp_value6|11|alpha|bb bb| input_file ... (4 Replies)
Discussion started by: greenworld123
4 Replies

4. Shell Programming and Scripting

Generate unique mac address

Hi, I want to generate 2000 mac address. Please let me know how to do so. Perl script or there is some tool availlable wherein i can give the count and it will generate that many mac-address Thanks, Kriti (4 Replies)
Discussion started by: kriti
4 Replies

5. Linux

Shell Script to generate Dynamic Param file Using SQL Plus Quey

Hi All, Can anyone give me Shell script sample script to generate Param file by Reading Values from SQL Plus query and it should assign those values to variables like.. $$SChema_Name='ORCL' Thanks in Advance... Srav... (4 Replies)
Discussion started by: Sravana Kumar
4 Replies

6. Shell Programming and Scripting

a shell script to generate an excel sheet from a text file..

hi, i have a text file that looks like this! i want to generate an excel sheet out of it, removing all the junk data except the addresses that look like . Arrow Electrical Services Rotating Machinery, Electrical Contracting & Mining Specialists Onsite maintenance, breakdown... (8 Replies)
Discussion started by: vemkiran
8 Replies

7. Shell Programming and Scripting

Create shell script to extract unique information from one file to a new file.

Hi to all, I got this content/pattern from file http.log.20110808.gz mail1 httpd: Account Notice: close igchung@abc.com 2011/8/7 7:37:36 0:00:03 0 0 1 mail1 httpd: Account Information: login sastria9@abc.com proxy sid=gFp4DLm5HnU mail1 httpd: Account Notice: close sastria9@abc.com... (16 Replies)
Discussion started by: Mr_47
16 Replies

8. Shell Programming and Scripting

How to generate 10.000 unique numbers?

hello, does anybody can give me a hint on how to generate a lot of numbers which are not identically via scripting etc? (7 Replies)
Discussion started by: xrays
7 Replies

9. Shell Programming and Scripting

Urgent: selecting unique specific content of a file using shell script

Hi, I have a file whose content and format at places is as given below. print coloumn .... coloumn .... coloumn .... skip 1 line print coloumn ... skip 1 line I need to select the following : print coloumn .... coloumn .... coloumn... (2 Replies)
Discussion started by: jisha
2 Replies

10. Shell Programming and Scripting

need to generate unique id from constant sid

Hello I have multiple accounts that running application that uses unique port number I want to generate this port from some sid number that stays constant for every user account , is there any place in the system that generate number that is unique to the account ? thanks (0 Replies)
Discussion started by: umen
0 Replies

Featured Tech Videos