Sponsored Content
Operating Systems OS X (Apple) A simple variable frequency sinewave audio generator. Post 303035893 by wisecracker on Friday 7th of June 2019 05:24:13 AM
Old 06-07-2019
Thanks MadeInGermany, I will try this out on my main code.

I limited the DEMO to 6000Hz because it kept the BYTE manipulation easy to understand using only one little endian word per sample and byterate instead of the two little endian words for both. Also 8 bits unsigned per sample, and mono eliminates the need for other sections to be altered.

As an addendum the WAV file format:

Microsoft WAVE soundfile format
 

8 More Discussions You Might Find Interesting

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

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

3. Windows & DOS: Issues & Discussions

A SOX 1KHz Sinewave Generator Using A Batch File...

Hi all... I don't think this has been done before but I am open to being corrected... This batch file generates a 65536 byte binary file to give 8 seconds of pure sinewave at the earphone/speaker output(s)... It uses ONLY a default Windows 32 bit installation, to Windows 7, except for the... (0 Replies)
Discussion started by: wisecracker
0 Replies

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

5. OS X (Apple)

Python script to do simple audio capture...

This site is the first to get this snippet. It will capture an audio recording of any time length within the limits of OSX's QuickTime Player's capablility... A shell script derivative of this will be used as a further capture for CygWin's AudioScope.sh. Thoroughly read ALL the comments in... (0 Replies)
Discussion started by: wisecracker
0 Replies

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

7. OS X (Apple)

Variable frequency audio generator...

Hi all... I intend to do an Audio Function Generator using Awk, (already started thanks to Don), but the biggest thing I have struggled with was variable frequency. I was going to generate differing sized waveforms on the fly but that would that would mean the frequencies are dependent on any... (2 Replies)
Discussion started by: wisecracker
2 Replies

8. Shell Programming and Scripting

The Start Of A Simple Audio Scope Shell Script...

This is a DEMO shell script to generate a simple graticule and plot inside it... Apologies for any typos... it is another building block along with my other two shell uploads recently to start a semi_serious project of an Terminal_AudioScope... The fist upload I posted recently was to show... (83 Replies)
Discussion started by: wisecracker
83 Replies
oggdec(1)							   Vorbis Tools 							 oggdec(1)

NAME
oggdec - simple decoder, Ogg Vorbis file to PCM audio file (WAV or RAW). SYNOPSIS
oggdec [ -Qhv ] [ -b bits_per_sample ] [ -e endianness ] [ -R ] [ -s signedness ] [ -o outputfile ] file ... DESCRIPTION
oggdec decodes Ogg Vorbis files into PCM-encoded ("uncompressed") audio files, either WAV or RAW format. For each input file, oggdec writes to a filename based on the input filename, but with the extension changed to ".wav" or ".raw" as appro- priate. If the input file is specified as - , then oggdec will read from stdin, and write to stdout unless an output filename is specified. Like- wise, an output filename of - will cause output to be to stdout. Writing WAV format to stdout is a bad idea. WAV requires a seekable medium for the header to be rewritten after all the data is written out; stdout is not seekable. OPTIONS
-Q, --quiet Suppresses program output. -h, --help Print help message. -v, --version Display version information. -b n, --bits=n Bits per sample. Valid values are 8 or 16. -e n, --endian=n Set endianness for 16-bit output. 0 (default) is little-endian (Intel byte order). 1 is big-endian (sane byte order). -R, --raw Output in raw format. If not specified, writes WAV file (RIFF headers). -s n, --sign=n Set signedness for output. 0 for unsigned, 1 (default) for signed. -o filename, --output=filename Write output to specified filename. This option is only valid if one input [file] is specified. EXAMPLES
Decode a file enabler.ogg to enabler.wav as little-endian unsigned 16-bit (default options): oggdec enabler.ogg Decode a file enabler.ogg to enabler.raw as headerless little-endian unsigned 16-bit: oggdec --raw=1 enabler.ogg Decode enabler.ogg to enabler.crazymonkey as unsigned 8-bit: oggdec -b 8 -s 0 -o enabler.crazymonkey enabler.ogg Decode enabler.ogg to enabler.raw as big-endian signed 16-bit (any of the following): oggdec -R -e 1 -b 16 enabler.ogg oggdec -R -e 1 -b 16 -o enabler.raw - < enabler.ogg oggdec -R -e 1 -b 16 - < enabler.ogg > enabler.raw Mass decoding (foo.ogg to foo.wav, bar.ogg to bar.wav, quux.ogg to quux.wav, etc.): oggdec *.ogg SEE ALSO
ogg123(1) AUTHORS
Program Authors Michael Smith <msmith@xiph.org> Manpage Authors Frederick Lee <phaethon@linux.ucla.edu>, assisted by a few million monkeys armed with keyboards in irc://irc.openprojects.net/#vorbis 2002 July 03 oggdec(1)
All times are GMT -4. The time now is 10:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy