I have a .wav file in my 'Files' folder which is a camera click.
I have this sub from another link on this site:
1. How do I save the file in Dir.Internal?
2. Is this sub appropriate or is there some other simpler routine which I can use?
Thanks
PK
I have this sub from another link on this site:
PlaySound:
Sub PlayRecording
Dim ret As Int 'Used in call to Pool.Play. ret = 0 if error occurs
Dim PoolID As Int 'Identifies the Pool number when a sound file is loaded
Dim SourceDir As String = File.DirInternal 'or the Directory where your file is located
Dim SourceFileName As String = "yourfilename.wav" 'The file you wish to use
Dim VolumeLeft As Double = 1 ' = Value between 0 and 1 for Left Channel
Dim VolumeRight As Double = 1 ' = Value between 0 and 1 for Right Channel
Dim Pitch As Double = 1 '= Value between 0 and 2: <1 is low pitch, 1 is normal, 2 is highest pitch
Dim Priority As Int = 1 'SoundPool Documentation says this value is irrelevant, is for future use
Dim Loop As Int = 0 'Number of times to repeat the sound, -1 to repeat indefinitely
'Load the sound
PoolID = Pool.Load(SourceDir,SourceFileName) 'Loads the file and gets it's number in the pool.
Sleep(100) 'Some delay required between pool loading and playback - I'm unsure why or how much?
'Play the sound
ret = Pool.Play(PoolID,VolumeLeft,VolumeRight,Priority,Loop,Pitch)
End Sub
1. How do I save the file in Dir.Internal?
2. Is this sub appropriate or is there some other simpler routine which I can use?
Thanks
PK