Sponsored Content
Operating Systems OS X (Apple) An Audio Function Generator... Post 302970069 by wisecracker on Friday 1st of April 2016 09:31:17 AM
Old 04-01-2016
Hi all...

Steady on guys I ain't that quick... ;oD

Don...
Your code did not work initially I had to do some minor changes.
BYTES is removed as the number '8' is bit depth per sample and will never change.
The reason is I want everything in this project to be pure ASCII including waveform generation; therefore 16 bit depth is a none starter and has two problems:-
1) You have to tell sox whether the two bytes per sample are big or little endian on raw data.
This is not necessary on 8 bit data.
2) Because of 1) there will ALWAYS be binary values and this defeats text mode waveform generation.
This also means I can create an arbitrary waveform in any text editor...
LBNL. I have no intention at this point of deleting the TMPFILEs so I have commented 'rm' out...

Mods to your code:-
Code:
	#### Change these two lines...
	COMMANDpt1 = "~/sox-14.4.0/sox -q -b 8 -r "
	COMMANDpt2 = " -e unsigned-integer " TMPFILE " -d trim 0 00:01 > /dev/null 2>&1"

		#### Change here correct lowercase Commandpt2...
		system(COMMANDpt1 RATE COMMANDpt2)

	exit # system("rm -rf " TMPFILE)

It now works...
A derivative of your code will be my starting point many thanks.
BTW your code answered my next question about global variables thanks for that too.
 

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. Shell Programming and Scripting

Sequence generator

Thanks Guys This really helped (5 Replies)
Discussion started by: robert89
5 Replies

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

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

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

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

8. Shell Programming and Scripting

Hostsfile generator

Hello I use a bash script to creating the hosts file /etc/hosts But there is a bug inside my output and I want to fix this. My Array looks like this: 205,IP 111.122.133.20 205,HOST2 unas 205,HOST1 unas15533 205,COMMENT # UNAS 775,IP ... (9 Replies)
Discussion started by: Marti95
9 Replies
SOAP::WSDL::Generator::Template::XSD(3pm)		User Contributed Perl Documentation		 SOAP::WSDL::Generator::Template::XSD(3pm)

NAME
SOAP::WSDL::Generator::Template::XSD - XSD code generator DESCRIPTION
SOAP::WSDL's XSD code generator SYNOPSIS
See wsdl2perl for an example on how to use this class. METHODS
new Constructor. Options (Options can also be set via set_OPTION methods): o silent Suppress warnings about what's being generated generate Shortcut for calling generate_typelib and generate_client generate_client Generates a client interface generate_server Generates a server class generate_typelib Generates type and element classes generate_typemap Generate a typemap class required by SOAP::WSDL's MessageParser generate_interface (Deprecated) alias for generate_client get_name_resolver Returns a name resolver template plugin visit_XSD_Attribute Visitor method for SOAP::WSDL::XSD::Attribute. Should be factored out into visitor class. visit_XSD_ComplexType Visitor method for SOAP::WSDL::XSD::ComplexType. Should be factored out into visitor class. visit_XSD_Element Visitor method for SOAP::WSDL::XSD::Element. Should be factored out into visitor class. visit_XSD_SimpleType Visitor method for SOAP::WSDL::XSD::SimpleType. Should be factored out into visitor class. AUTHOR
Replace the whitespace by @ for E-Mail Address. Martin Kutter E<lt>martin.kutter fen-net.deE<gt> LICENSE AND COPYRIGHT
Copyright 2008, 2009 Martin Kutter. This file is part of SOAP-WSDL. You may distribute/modify it under the same terms as perl itself Repository information $Id: WSDLParser.pm 770 2009-01-24 22:55:54Z kutterma $ $LastChangedDate: 2009-01-24 23:55:54 +0100 (Sa, 24 Jan 2009) $ $LastChangedRevision: 770 $ $LastChangedBy: kutterma $ $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Expat/WSDLParser.pm $ perl v5.10.1 2010-12-21 SOAP::WSDL::Generator::Template::XSD(3pm)
All times are GMT -4. The time now is 09:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy