PS: don't forget it requires "32bit_float.wv" maybe you want to put some openFileRequester () there.wilbert wrote:Code: Select all
EnumerationBinary #OPEN_WVC #OPEN_TAGS #OPEN_WRAPPER #OPEN_2CH_MAX #OPEN_NORMALIZE #OPEN_STREAMING #OPEN_EDIT_TAGS #OPEN_FILE_UTF8 EndEnumeration ImportC "wavpackdll.lib" WavpackCloseFile (*wpc) WavpackGetBitsPerSample (*wpc) WavpackGetBytesPerSample (*wpc) WavpackGetNumChannels (*wpc) WavpackGetNumSamples (*wpc) WavpackGetReducedChannels (*wpc) WavpackGetSampleRate (*wpc) WavpackOpenFileInput (infilename.p-ascii, *error, flags, norm_offset) WavpackSeekSample (*wpc, sample) WavpackUnpackSamples (*wpc, *buffer, samples) EndImport *error = AllocateMemory(81) *wpc = WavpackOpenFileInput("32bit_float.wv", *error, 0, 0) If *wpc = 0 Debug PeekS(*error, -1, #PB_Ascii) Else numChannels = WavpackGetNumChannels(*wpc) bitsPerSample = WavpackGetBitsPerSample(*wpc) bytesPerSample = WavpackGetBytesPerSample(*wpc) sampleRate = WavpackGetSampleRate(*wpc) numSamples = WavpackGetNumSamples(*wpc) Debug "Channels : " + Str(numChannels) Debug "Bits per sample : " + Str(bitsPerSample) Debug "Bytes per sample : " + Str(bytesPerSample) Debug "Sample rate : " + Str(sampleRate) Debug "" Debug "Number of samples : " + Str(numSamples) BufferSize = 4 * numSamples * numChannels *Buffer = AllocateMemory(BufferSize) If *Buffer And WavpackUnpackSamples(*wpc, *Buffer, numSamples) = numSamples Debug "Decoded" Else Debug "Decode error" EndIf WavpackCloseFile(*wpc) EndIf
[SOLVED] wavPack decoder
[SOLVED] wavPack decoder
For wavPack an official dll package exists on their major web page http://www.wavpack.com/ for download and usag of the .lib file distributed using, for example, the code postd by wilbert below:

Last edited by es_91 on Sun Sep 11, 2016 7:33 am, edited 2 times in total.
Re: [USERLIB] wavPack decoder
i could be mistaken but i'm pretty sure you only need a license from Fraunhoffer or whatever if you want to write a (commercial) ENCODER for mp3 - everyone is free to write their own decoder, including commercial - again, if i'm not mistaken. I think the LAME codec is able to get away with encoding because it's free. But don't quote me on any of this!es_91 wrote:Soon, i believe, the last mp3 patents in US are running out ... maybe one day Fred and Timo will provide MP3 decoder plugins within PureBasic?
Re: [USERLIB] wavPack decoder
I won't.Keya wrote:But don't quote me on any of this!
[edited]
en. wikipedia. org /wiki /MP3 #Licensing, ownership and legislationThe basic MP3 decoding and encoding technology is patent-free in the European Union, all patents having expired there. In the United States, the technology will be substantially patent-free on 31 December 2017 (see below).
Last edited by es_91 on Sat Sep 10, 2016 1:11 am, edited 1 time in total.
Re: [USERLIB] wavPack decoder
Stages in becoming a programmer:
1) Become a lawyer
2) Learn programming
3) Get sued by a troll over some ridiculous software patent
Congratulations, YOU'VE MADE IT!
1) Become a lawyer
2) Learn programming
3) Get sued by a troll over some ridiculous software patent
Congratulations, YOU'VE MADE IT!
Re: [USERLIB] wavPack decoder
guess you gotta do IT with a little protection these days ...
Last edited by es_91 on Sat Sep 10, 2016 9:27 am, edited 2 times in total.
Re: [USERLIB] wavPack decoder
They do offer a dll
http://www.wavpack.com/downloads.html
http://www.wavpack.com/downloads.html
Windows (x64)
Raspberry Pi OS (Arm64)
Raspberry Pi OS (Arm64)
Re: [USERLIB] wavPack decoder
[...] Sorry, no experience, no skills.
But I'll give it a try if that's what you meant. ..which you surely did. ^^
But I'll give it a try if that's what you meant. ..which you surely did. ^^
Last edited by es_91 on Sun Sep 11, 2016 7:34 am, edited 1 time in total.
Re: [USERLIB] wavPack decoder
The zip file contains a pre-build dll and lib for Windows both x86 and x64.es_91 wrote:But I'll give it a try if that's what you meant. ..which you surely did. ^^
http://www.wavpack.com/wavpackdll.zip
Code: Select all
EnumerationBinary
#OPEN_WVC
#OPEN_TAGS
#OPEN_WRAPPER
#OPEN_2CH_MAX
#OPEN_NORMALIZE
#OPEN_STREAMING
#OPEN_EDIT_TAGS
#OPEN_FILE_UTF8
EndEnumeration
EnumerationBinary
#MODE_WVC
#MODE_LOSSLESS
#MODE_HYBRID
#MODE_FLOAT
#MODE_VALID_TAG
#MODE_HIGH
#MODE_FAST
#MODE_EXTRA
#MODE_APETAG
#MODE_SFX
#MODE_VERY_HIGH
#MODE_MD5
#MODE_XMODE = $7000
#MODE_DNS = $8000
EndEnumeration
ImportC "wavpackdll.lib"
WavpackCloseFile (*wpc)
WavpackGetBitsPerSample (*wpc)
WavpackGetBytesPerSample (*wpc)
WavpackGetMode (*wpc)
WavpackGetNumChannels (*wpc)
WavpackGetNumSamples (*wpc)
WavpackGetReducedChannels (*wpc)
WavpackGetSampleRate (*wpc)
WavpackOpenFileInput (infilename.p-ascii, *error, flags, norm_offset)
WavpackSeekSample (*wpc, sample)
WavpackUnpackSamples (*wpc, *buffer, samples)
EndImport
*error = AllocateMemory(81)
*wpc = WavpackOpenFileInput("32bit_float.wv", *error, 0, 0)
If *wpc = 0
Debug PeekS(*error, -1, #PB_Ascii)
Else
numChannels = WavpackGetNumChannels(*wpc)
bitsPerSample = WavpackGetBitsPerSample(*wpc)
bytesPerSample = WavpackGetBytesPerSample(*wpc)
sampleRate = WavpackGetSampleRate(*wpc)
numSamples = WavpackGetNumSamples(*wpc)
Debug "Channels : " + Str(numChannels)
Debug "Bits per sample : " + Str(bitsPerSample)
Debug "Bytes per sample : " + Str(bytesPerSample)
Debug "Sample rate : " + Str(sampleRate)
Debug ""
Debug "Number of samples : " + Str(numSamples)
BufferSize = 4 * numSamples * numChannels
*Buffer = AllocateMemory(BufferSize)
If *Buffer And WavpackUnpackSamples(*wpc, *Buffer, numSamples) = numSamples
Debug "Decoded"
Else
Debug "Decode error"
EndIf
WavpackCloseFile(*wpc)
EndIf
Last edited by wilbert on Sun Sep 11, 2016 3:02 pm, edited 6 times in total.
Windows (x64)
Raspberry Pi OS (Arm64)
Raspberry Pi OS (Arm64)
Re: [USERLIB] wavPack decoder
My bad. Thank you. Much appreciated! 
Last edited by es_91 on Sun Sep 11, 2016 7:35 am, edited 1 time in total.
Re: [USERLIB] wavPack decoder
It seems like you have to convert the samples yourself to the sample format you wish.es_91 wrote:Nice to have wavPack.
Windows (x64)
Raspberry Pi OS (Arm64)
Raspberry Pi OS (Arm64)
Re: [USERLIB] wavPack decoder
Yes. That is something wavPack does not want to do. Equal to this: wavPack will not convert CD-resoluted material too far below 200 kbit/s. That again, for quality purposes. With lower resoluting material, rates below 50 kbit/s are possible.
If you wish to not just compress or reduce data, but also to resample it, wavPack probably won't offer a build-in solution.
And honestly, i think that is the right choice.
If you wish to not just compress or reduce data, but also to resample it, wavPack probably won't offer a build-in solution.
And honestly, i think that is the right choice.


