Sponsored Content
Operating Systems OS X (Apple) Variable frequency audio generator... Post 302979799 by wisecracker on Friday 19th of August 2016 05:32:04 AM
Old 08-19-2016
Hi Corona688...

Files are not needed if you are using SOX and piping.
An ultra simple string piped into sox without the need for files at all...
But I am NOT using SOX here but the very, very limited afplay audio player for OSX.
afplay cannot replay raw files only a few basic formats of which .WAV is one.
Code:
#!/usr/local/bin/dash
square="    ~~~~"
for n in 1 2 3 4 5 6 7 8 9 10
do
	square=$square$square
done
echo "$square" | sox -b 8 -c 1 -e unsigned-integer -t raw -r 8000 - -d

Results:-
Code:
Last login: Fri Aug 19 10:08:28 on ttys000
AMIGA:barrywalker~> cd Desktop/Code/Shell
AMIGA:barrywalker~/Desktop/Code/Shell> chmod 755 sox_pipe.sh
AMIGA:barrywalker~/Desktop/Code/Shell> ./sox_pipe.sh

-: (raw)

  Encoding: Unsigned PCM  
  Channels: 1 @ 8-bit    
Samplerate: 8000Hz       
Replaygain: off         
  Duration: unknown      

In:0.00% 00:00:01.02 [00:00:00.00] Out:45.2k [======|======] Hd:1.3 Clip:0    
Done.
AMIGA:barrywalker~/Desktop/Code/Shell> _

Just change the sample speed inside SOX from 8000 to anything you like within limits.
 

8 More Discussions You Might Find Interesting

1. Solaris

out of frequency

:cool: after installing solaris 10 5/08/09 directory the computer rebooting then the massage "out of frequency" appear.i want a solution first second my main board is GA-MA780G UD3H (14 Replies)
Discussion started by: medo2008
14 Replies

2. Shell Programming and Scripting

Bash - Same frequency

Hi, Could anyone help me with the following question, if I have two colums (names and frequency) as follows in a file called name.txt Michael 1 Jones 1 Ben 2 Rebeca 4 David 1 and I want to use bash script called freqnames.sh that takes one argument (name) and the output should be... (3 Replies)
Discussion started by: jboy
3 Replies

3. Programming

Python, Platform Independent, Pure Audio Sinewave Generator...

IKHz_SW_OSX.py A DEMO mono _pure_ sinewave generator using standard text mode Python 2.6.7 to at least 2.7.3. This code is EASILY modifyable to Python version 3.x.x... This DEMO kids level 1KHz generator is mainly for a MacBook Pro, (13 inch in my case), OSX 10.7.5 and above. See below...... (0 Replies)
Discussion started by: wisecracker
0 Replies

4. Shell Programming and Scripting

A Crude 1KHz Audio Sinewave Generator Demo...

A very simple crude sinewave generator. The file required is generated inside the code, is linear interpolated and requires /dev/audio to work. Ensure you have this device, if not the download oss-compat from your OS's repository... It lasts for about 8 seconds before exiting and saves a... (5 Replies)
Discussion started by: wisecracker
5 Replies

5. 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

6. 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

7. OS X (Apple)

An Audio Function Generator...

Ok guys, gals and geeks... As from today I am starting to learn awk in earnest doing something totally different. I am going to create a pseudo-Audio_Function Generator centred around OSX 10.11.x minimum. The code below is a tester to see what the possibilities are. All waveforms will be... (11 Replies)
Discussion started by: wisecracker
11 Replies

8. OS X (Apple)

A simple variable frequency sinewave audio generator.

Hi all... Well I have not been inactive but working out how to make OSX 10.14.x command line audio player have a variable sample rate. This is a back door as afplay does not have a sample rate flag unlike aplay for ALSA, in Linux flavours. This is a DEMO only but a derivative of it will... (2 Replies)
Discussion started by: wisecracker
2 Replies
BCHUNK(1)						      General Commands Manual							 BCHUNK(1)

NAME
bchunk - CD image format conversion from bin/cue to iso/cdr SYNOPSIS
bchunk [-v] [-p] [-r] [-w] [-s] <image.bin> <image.cue> <basename> DESCRIPTION
bchunk converts a CD image in a ".bin / .cue" format (sometimes ".raw / .cue") to a set of .iso and .cdr tracks. The bin/cue format is used by some non-Unix cd-writing software, but is not supported on most other cd-writing programs. image.bin is the raw cd image file. image.cue is the track index file containing track types and offsets. basename is used for the begin- ning part of the created track files. The produced .iso track contains an ISO file system, which can be mounted through a loop device on Linux systems, or written on a CD-R using cdrecord. The .cdr tracks are in the native CD audio format. They can be either written on a CD-R using cdrecord -audio, or con- verted to WAV (or any other sound format for that matter) using sox. The output type depends on the input type (data is just copied). If the input is in ISO format, the output will be. On the other hand, if the input is raw audio data, the output will be CDR or WAV (the latter if -w is given). It is advisable to edit the .cue file to either MODE2/2352/2048 or MODE2/2352/2324 depending on whether an ISO filesystem or a VCD is desired, respectively. The format itself does not contain this feature and in an ambiguous case it can only guess. OPTIONS
-v Makes binchunker print some more unnecessary messages, which should not be of interest for anyone. -w Makes binchunker write audio tracks in WAV format. -s Makes binchunker swap byte order in the samples of audio tracks. -p Makes binchunker go into PSX mode and truncate MODE2/2352 tracks to 2336 bytes at offset 0 instead of normal 2048 bytes at offset 24. Use this option if input is in PSX mode. -r Makes binchunker output MODE2/2352 tracks in raw format, from offset 0 for 2352 bytes. Good for MPEG/VCD. Use this option if input is in raw format. FILES
image.bin Raw CD image file image.cue TOC (Track index, Table Of Contents) file *.iso Tracks in ISO9660 CD filesystem format. Can be either written on a CD-R using cdrecord, or mounted (on Linux platforms at least) through a loop device ('mount track.iso /mnt/cdrom -o loop=/dev/loop0,blocksize=1024'). *.cdr Audio tracks in native CD audio format. They can be either written on a CD-R using 'cdrecord -audio', or converted to WAV (or any other sound format for that matter) using sox ('sox track.cdr track.wav'). *.wav Audio tracks in WAV format. SEE ALSO
cdrecord(1), mkisofs(8), sox(1), cdrdao(1) AUTHORS
Heikki Hannikainen <hessu@hes.iki.fi> Bob Marietta <marietrg@SLU.EDU> Colas Nahaboo <Colas@Nahaboo.com> Godmar Back <gback@cs.utah.edu> Matthew Green <mrg@eterna.com.au> Heikki Hannikainen v1.2.0 29 Jun 2004 BCHUNK(1)
All times are GMT -4. The time now is 11:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy