Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Code Samples & Tips > Additional Libraries
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Additional Libraries Users contributed libraries.
This sub-forum is only available to licensed users.

Wav file tone generation library.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-21-2008, 03:00 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default Wav file tone generation library.

Unlike some versions of Basic Basic4PPC does not implement a Beep statement that can specify the frequency and duration of a tone. These libraries, one each for desktop and device, let you write a wav file of the required frequency and duration. They also provide playback of any wav file with some additional options not available to the Basic4PPC Sound facility.

I knocked these libraries up for a specific use in another thread but thought that I would post them here complete with demo app and help file in case they are of use to anyone else.
Attached Files
File Type: zip WavFileGen1.0.zip (13.9 KB, 267 views)
Reply With Quote
  #2 (permalink)  
Old 11-11-2008, 08:51 PM
Basic4ppc Veteran
 
Join Date: May 2008
Location: Newcastle Upon Tyne - England
Posts: 271
Awards Showcase
Beta Tester 
Total Awards: 1
Default

I've been using the Wav library in one of my apps for calibrating our mechanical timers - if the user is too slow it gives five low tones, too fast five high tones and within range, a continuous mid tone. Very useful.

Then fiddling a bit with the demo application, agraham's note about having the sampling 2.5 times the desired frequency is quite important. For example, if you keep the default rate of 11025samp.s-1; play a tone of 6kHz and 8kHz. The 8kHz tone sounds appreciably lower than the 6kHz tone. A good example of Quantization. That's probably why CD audio is sampled at 44.1kHz.

Using 44100 with the library produces the correct tone.
Reply With Quote
  #3 (permalink)  
Old 11-12-2008, 07:56 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by Zenerdiode View Post
A good example of Quantization.
To be pedantic is actually Aliasing
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
FilesEx library - returns file information agraham Additional Libraries 21 03-30-2011 12:29 PM
Barcode generation Lib Mr_Gee Additional Libraries 4 03-24-2011 12:59 PM
Door library (Beta) - Special library Erel Official Updates 60 01-13-2011 11:23 AM
Merging Outlook library and Phone library Erel Official Updates 11 09-15-2010 09:22 AM
CSV file generates strange start in file sunnyboyj Questions (Windows Mobile) 9 12-21-2007 08:38 PM


All times are GMT. The time now is 10:37 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0