New version of the 'Audiere For Purebasic' pack
OK...so I tried windows MM, and no more crackling! BUT--some mp3 files won't open, while others will. I get an error saying "Error creating a new sample source"....and when opening an mp3 recorded at 22050hz, it plays back in double time! ....just checked, and the mp3s I can't open are 48000hz files....
Bryan
Bryan
just have a look to your task manager/processes, and you'll see that ogg playing take more memory than mp3 (but less cpu time).
It was just a observation.
I think I will use it in my project.
It was just a observation.
We know that, but your include file is great :)ps. I wrote only the include file for Purebasic. That's all.
I think I will use it in my project.
WolfGang, Im sorry I sounded so hard on you.. I really didnt mean to. And I want to thank you for providing the Include file for us PB users
I just meant to say that I found the actual library (not the include file), lacking 
Hey coma, where did you get your avatar at? I wanna make a poster for my daughter's room..


Hey coma, where did you get your avatar at? I wanna make a poster for my daughter's room..
Can you send me those files ?bcgreen wrote:OK...so I tried windows MM, and no more crackling! BUT--some mp3 files won't open, while others will. I get an error saying "Error creating a new sample source"....and when opening an mp3 recorded at 22050hz, it plays back in double time! ....just checked, and the mp3s I can't open are 48000hz files....
Bryan
MFG
WolfgangS
WolfgangS' projects http://www.schliess.net
Quotation of the month:
<p3hicy>oder ich hol mir so eine geile aus asien
<p3hicy>die ständig poppen will
<p3hicy>'n brötchen pro tag reicht doch
<p3hicy>die essen eh' nich so viel
Quotation of the month:
<p3hicy>oder ich hol mir so eine geile aus asien
<p3hicy>die ständig poppen will
<p3hicy>'n brötchen pro tag reicht doch
<p3hicy>die essen eh' nich so viel
Confirmed. I reported this information to the author of the libaray.bcgreen wrote:OK...so I tried windows MM, and no more crackling! BUT--some mp3 files won't open, while others will. I get an error saying "Error creating a new sample source"....and when opening an mp3 recorded at 22050hz, it plays back in double time! ....just checked, and the mp3s I can't open are 48000hz files....
Bryan
Thanks for your help !
MFG
WolfganGS
WolfgangS' projects http://www.schliess.net
Quotation of the month:
<p3hicy>oder ich hol mir so eine geile aus asien
<p3hicy>die ständig poppen will
<p3hicy>'n brötchen pro tag reicht doch
<p3hicy>die essen eh' nich so viel
Quotation of the month:
<p3hicy>oder ich hol mir so eine geile aus asien
<p3hicy>die ständig poppen will
<p3hicy>'n brötchen pro tag reicht doch
<p3hicy>die essen eh' nich so viel
Try to increase the size of the buffer (try 500, 100, 300, 500, 10000) and tell me what happens please .bcgreen wrote:Hmmm....I get lots of crackling in the audio that I don't get using any other mp3 player....
MFG
WolfgangS
WolfgangS' projects http://www.schliess.net
Quotation of the month:
<p3hicy>oder ich hol mir so eine geile aus asien
<p3hicy>die ständig poppen will
<p3hicy>'n brötchen pro tag reicht doch
<p3hicy>die essen eh' nich so viel
Quotation of the month:
<p3hicy>oder ich hol mir so eine geile aus asien
<p3hicy>die ständig poppen will
<p3hicy>'n brötchen pro tag reicht doch
<p3hicy>die essen eh' nich so viel
From the audiere logfile:bcgreen wrote:OK...so I tried windows MM, and no more crackling! BUT--some mp3 files won't open, while others will. I get an error saying "Error creating a new sample source"....and when opening an mp3 recorded at 22050hz, it plays back in double time! ....just checked, and the mp3s I can't open are 48000hz files....
Bryan
fixed: some MP3 were returning incorrect sample format info, so they sounded wrong
This is just for info ... now we have to wait for the next release

MFG
WolfgangS
WolfgangS' projects http://www.schliess.net
Quotation of the month:
<p3hicy>oder ich hol mir so eine geile aus asien
<p3hicy>die ständig poppen will
<p3hicy>'n brötchen pro tag reicht doch
<p3hicy>die essen eh' nich so viel
Quotation of the month:
<p3hicy>oder ich hol mir so eine geile aus asien
<p3hicy>die ständig poppen will
<p3hicy>'n brötchen pro tag reicht doch
<p3hicy>die essen eh' nich so viel
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
Anyone know where this is now, the link is dead... 
-Anthony

-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
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
Thanks 

https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
Hi, guys.
As I was learning how to work with INTERFACES, I created a small AUDIERE include file based on WolfgangS interfaces. I removed some things to keep the code tight and replaced all CallFunction() with Prototypes. It works with AUDIERE version 1.9.4, AFAICT.
Have fun.
audiere.pbi
example.pb
.
As I was learning how to work with INTERFACES, I created a small AUDIERE include file based on WolfgangS interfaces. I removed some things to keep the code tight and replaced all CallFunction() with Prototypes. It works with AUDIERE version 1.9.4, AFAICT.
Have fun.

audiere.pbi
Code: Select all
Interface RefCounted
ref() ; Long
unref() ; Long
EndInterface
Interface file Extends RefCounted
_Read(pbuffer.l,size.l) ; long
seek(position.l,SeekMode.l) ; bool
tell() ; long
EndInterface
Interface SampleBuffer Extends RefCounted
getFormat(channel_count.l,sample_rate.l,sample_format.l) ; void
getLength() ; long
getSamples() ; long
openStream() ; pSampleSource
EndInterface
Interface SampleSource Extends RefCounted
getFormat(long.l,long.l) ; void
Read(long.l,long.l) ; long
reset() ; void
isSeekable() ; bool
getLength() ; long
setPosition(long.l) ; void
getPosition() ; long
getRepeat() ; bool
setRepeat(bool.l) ; void
EndInterface
Interface LoopPointSource Extends SampleSource
addLoopPoint(location.l,target.l,loopCount.l) ; void
removeLoopPoint(index.l) ; void
getLoopPointCount() ; long
getLoopPoint(index.l,plocation.l,ptarget.l,ploopCount.l) ; bool
EndInterface
Interface OutputStream Extends RefCounted
play()
stop() ; bool
isPlaying() ; bool
reset() ; void
setRepeat(bool.l) ; void
getRepeat() ; bool
setVolume(float.f) ; void
getVolume() ; float
setPan(float.f) ; void
getPan() ; float
setPitchShift(float.f) ; void
getPitchShift() ; float
isSeekable() ; bool
getLength() ; int
setPosition(int.l) ; void
getPosition() ; int
EndInterface
Interface AudioDevice Extends RefCounted
update() ; void
openStream(pSampleSource.l) ; OutputStream.l
openBuffer(pSamples.l,frame_count.l,channel_count.l,sample_rate.l,sample_format.l); OutputStream*
getName() ; char.l
EndInterface
Interface SoundEffect Extends RefCounted
play() ; void
stop() ; void
setVolume(volume.f) ; void
getVolume() ; float
setPan(pan.f) ; void
getPan() ; float
setPitchShift(shift.f) ; void
getPitchShift() ; float
EndInterface
Enumeration ; SampleFormat
#SF_U8 ; unsigned 8-bit integer [0,255]
#SF_S16 ; signed 16-bit integer in host endianness [-32768,32767]
EndEnumeration
Enumeration ; FileFormat
#FF_AUTODETECT
#FF_WAV
#FF_OGG
#FF_FLAC
#FF_MP3
#FF_MOD
#FF_AIFF
EndEnumeration
Enumeration ; SoundEffectType
#SINGLE
#MULTIPLE
EndEnumeration
Enumeration ; SeekMode
#begin
#current
#End
EndEnumeration
audiere = OpenLibrary(#PB_Any, "audiere.dll")
Prototype.l _AdrCreateLoopPointSource(SampleSource.l)
Global AdrCreateLoopPointSource._AdrCreateLoopPointSource = GetFunction(audiere, "_AdrCreateLoopPointSource@4")
Prototype.l _AdrCreateMemoryFile(*Buffer, BufferSize.l)
Global AdrCreateMemoryFile._AdrCreateMemoryFile = GetFunction(audiere, "_AdrCreateMemoryFile@8")
Prototype.l _AdrCreatePinkNoise()
Global AdrCreatePinkNoise._AdrCreatePinkNoise = GetFunction(audiere, "_AdrCreatePinkNoise@0")
Prototype.l _AdrCreateSampleBuffer(*Samples, FrameCount.l, ChannelCount.l, SampleRate.l, SampleFormat.l)
Global AdrCreateSampleBuffer._AdrCreateSampleBuffer = GetFunction(audiere, "_AdrCreateSampleBuffer@20")
Prototype.l _AdrCreateSampleBufferFromSource(SampleSource.l)
Global AdrCreateSampleBufferFromSource._AdrCreateSampleBufferFromSource = GetFunction(audiere, "_AdrCreateSampleBufferFromSource@4")
Prototype.l _AdrCreateSquareWave(Frequency.d)
Global AdrCreateSquareWave._AdrCreateSquareWave = GetFunction(audiere, "_AdrCreateSquareWave@8")
Prototype.l _AdrCreateTone(Frequency.d)
Global AdrCreateTone._AdrCreateTone = GetFunction(audiere, "_AdrCreateTone@8")
Prototype.l _AdrCreateWhiteNoise()
Global AdrCreateWhiteNoise._AdrCreateWhiteNoise = GetFunction(audiere, "_AdrCreateWhiteNoise@0")
Prototype.l _AdrEnumerateCDDevices()
Global AdrEnumerateCDDevices._AdrEnumerateCDDevices = GetFunction(audiere, "_AdrEnumerateCDDevices@0")
Prototype.l _AdrGetSampleSize(SampleFormat.l)
Global AdrGetSampleSize._AdrGetSampleSize = GetFunction(audiere, "_AdrGetSampleSize@4")
Prototype.l _AdrGetSupportedAudioDevices()
Global AdrGetSupportedAudioDevices._AdrGetSupportedAudioDevices = GetFunction(audiere, "_AdrGetSupportedAudioDevices@0")
Prototype.l _AdrGetSupportedFileFormats()
Global AdrGetSupportedFileFormats._AdrGetSupportedFileFormats = GetFunction(audiere, "_AdrGetSupportedFileFormats@0")
Prototype.l _AdrGetVersion()
Global AdrGetVersion._AdrGetVersion = GetFunction(audiere, "_AdrGetVersion@0")
Prototype.l _AdrOpenCDDevice(DeviceName.s)
Global AdrOpenCDDevice._AdrOpenCDDevice = GetFunction(audiere, "_AdrOpenCDDevice@4")
Prototype.l _AdrOpenDevice(DeviceName.s, Options.s)
Global AdrOpenDevice._AdrOpenDevice = GetFunction(audiere, "_AdrOpenDevice@8")
Prototype.l _AdrOpenFile(Filename.s, Writeable.l)
Global AdrOpenFile._AdrOpenFile = GetFunction(audiere, "_AdrOpenFile@8")
Prototype.l _AdrOpenMIDIDevice(DeviceName.s)
Global AdrOpenMIDIDevice._AdrOpenMIDIDevice = GetFunction(audiere, "_AdrOpenMIDIDevice@4")
Prototype.l _AdrOpenSampleSource(Filename.s, FileFormat.l)
Global AdrOpenSampleSource._AdrOpenSampleSource = GetFunction(audiere, "_AdrOpenSampleSource@8")
Prototype.l _AdrOpenSampleSourceFromFile(FileHandle.l, FileFormat.l)
Global AdrOpenSampleSourceFromFile._AdrOpenSampleSourceFromFile = GetFunction(audiere, "_AdrOpenSampleSourceFromFile@8")
Prototype.l _AdrOpenSound(Device.l, SampleSource.l, Streaming.l)
Global AdrOpenSound._AdrOpenSound = GetFunction(audiere, "_AdrOpenSound@12")
Prototype.l _AdrOpenSoundEffect(Device.l, SoundSource.l, SoundEffectType.l)
Global AdrOpenSoundEffect._AdrOpenSoundEffect = GetFunction(audiere, "_AdrOpenSoundEffect@12")
example.pb
Code: Select all
IncludeFile "audiere.pb"
If OpenWindow(0, #PB_Ignore, #PB_Ignore, 320, 200, "Audiere Demo", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
If CreateGadgetList(WindowID(0))
ButtonGadget(0, WindowWidth(0)/2-100, WindowHeight(0)/2-20, 200, 40, "AUDIERE Sample")
EndIf
EndIf
Debug PeekS(AdrGetVersion())
Debug PeekS(AdrEnumerateCDDevices())
Debug PeekS(AdrGetSupportedAudioDevices())
Debug PeekS(AdrGetSupportedFileFormats())
device.AudioDevice = AdrOpenDevice("winmm", "buffer=1000,rate=44100")
If device
source.SampleSource = AdrOpenSampleSource("12 - CHANGE THE FUTURE.mp3",#FF_AUTODETECT)
If source
stream.OutputStream = AdrOpenSound(device, source, #True)
device\ref()
source\ref()
stream\ref()
stream\play()
EndIf
EndIf
Repeat
event = WaitWindowEvent()
Select event
Case #PB_Event_CloseWindow
Fim = #True
Case #PB_Event_Gadget
Select EventGadget()
Case 0
If stream\isPlaying()
stream\stop()
Else
stream\play()
EndIf
EndSelect
EndSelect
Until Fim
If stream\isPlaying()
stream\stop()
EndIf
stream\unref()
source\unref()
device\unref()
Re: New version of the 'Audiere For Purebasic' pack
Hi, thanks for posting the code, since WolfgangS' page is offline.
But I get an IMA (at Adresse: 0) at line 40 (in the example): If stream\isPlaying() (after clicking the button, ofcourse).
I have the audiere.dll 1.9.4
The dll can be downloaded here: http://audiere.sourceforge.net/download.php
The manual can be found here, if that helps: http://audiere.sourceforge.net/audiere- ... s-doxygen/
I hope someone can help me.
But I get an IMA (at Adresse: 0) at line 40 (in the example): If stream\isPlaying() (after clicking the button, ofcourse).
I have the audiere.dll 1.9.4
The dll can be downloaded here: http://audiere.sourceforge.net/download.php
The manual can be found here, if that helps: http://audiere.sourceforge.net/audiere- ... s-doxygen/
I hope someone can help me.
Re: New version of the 'Audiere For Purebasic' pack
Did you set
to point to a valid file?
That same line you mentioned also fails if you're trying to compile a unicode executable...
Code: Select all
source.SampleSource = AdrOpenSampleSource("12 - CHANGE THE FUTURE.mp3",#FF_AUTODETECT)
That same line you mentioned also fails if you're trying to compile a unicode executable...

Re: New version of the 'Audiere For Purebasic' pack
No. What a fool I amhapper66 wrote:Did you set
source.SampleSource = AdrOpenSampleSource("12 - CHANGE THE FUTURE.mp3",#FF_AUTODETECT)
to point to a valid file?


Thanks so much
