I need to change ie  read and write the sound card sampling rate. 
I am sure there is an API for it but for the life of me I can't find it!
Any help welcomed.
Alan
			
			
									
									sound card sampling speed
sound card sampling speed
PB v3.94 PVXP v2.13 JaPBe v2.5.4.22
						Here is how I solved the problem of changing the sampling speed of the soundcard.
Hope it is useful.
Alan
			
			
													Code: Select all
OpenLibrary(1,"winmm.dll")
Structure WAVEFORMATEX 
  wFormatTag.w 
  nChannels.w 
  nSamplesPerSec.l 
  nAvgBytesPerSec.l 
  nBlockAlign.w 
  wBitsPerSample.w 
  cbSize.w 
EndStructure 
Global waveheader1.WAVEHDR
Global waveform.WAVEFORMATEX
Procedure changesample(sample$)
waveform\wFormatTag = #WAVE_FORMAT_PCM
waveform\nChannels = 1
waveform\nSamplesPerSec = Val(sample$)
waveform\wBitsPerSample = 8
waveform\nBlockAlign = waveform\nChannels * waveform\wBitsPerSample / 8
waveform\nAvgBytesPerSec = waveform\nSamplesPerSec * waveform\nBlockAlign
waveform\cbSize=0
   
dwRet.l=CallFunction(1,"waveInOpen",@wavehandle, #WAVE_MAPPER, @waveform,0,0,0)
EndProcedure
Alan
					Last edited by chippy73 on Wed Mar 23, 2005 4:32 pm, edited 1 time in total.
									
			
									PB v3.94 PVXP v2.13 JaPBe v2.5.4.22
						- DoubleDutch
 - Addict

 - Posts: 3220
 - Joined: Thu Aug 07, 2003 7:01 pm
 - Location: United Kingdom
 - Contact:
 
Is there something i'm missing here...
What library did you open...
 
 
Anthony
			
			
									
									What library did you open...
Anthony
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
						https://reportcomplete.com <- School end of term reports system

