Page 1 of 2
LibZPlay wrapper (updated)
Posted: Sat Mar 23, 2013 11:36 am
by erion
Hey,
I have updated TS-Soft's wrapper of LibZPlay to include some functions from the 2.0 release.
See
this page for downloads.
The original post is
here.
Cheers,
Erion
Re: LibZPlay wrapper (updated)
Posted: Tue May 28, 2013 7:28 am
by Poshu
Ooooh, I needed this! Thanks

Re: LibZPlay wrapper (updated)
Posted: Tue Jul 09, 2013 10:31 am
by Angelo
Great work from Erion and TS-Soft. Unfortunately, I got one problem. The following code produces two linker errors of the type "unresolved external symbol":
Code: Select all
XIncludeFile "libzplay.pbi"
hZPlay = CreateZPlay()
zplay_SetWaveInDevice(hZPlay, 0)
num = zplay_EnumerateWaveIn(hZPlay)
I cannot see the reason for it!
Re: LibZPlay wrapper (updated)
Posted: Wed Jul 10, 2013 9:33 am
by erion
The reason you are getting those is because you are compiling using the x64 version of PB.
Since LibZPlay is a 32 bit library, it will only compile using the 32 bit version of PB.
Erion
Re: LibZPlay wrapper (updated)
Posted: Wed Jul 10, 2013 3:26 pm
by Angelo
Erion, thanks for your reply. But this is not the reason, because I use the x86-Version of PB. What is rather interesting is the fact, that all the functions you added to the include produce this linker error.
By the way, I just posted the following in the german forum: There's a little typo in TS-Soft's include-file. The correct definition is:
Code: Select all
zplay_GetStreamInfo(hZPlay, *pInfo.TStreamInfo)
zplay_GetStreamInfoW(hZPlay, *pInfo.TStreamInfoW)
Re: LibZPlay wrapper (updated)
Posted: Wed Jul 10, 2013 3:57 pm
by erion
Hi,
Thanks for the include correction.
Interesting. Which version of x86 PB are you using? It compiles fine here under Win8 x64 using PB 5.11.
Erion
Re: LibZPlay wrapper (updated)
Posted: Wed Jul 10, 2013 5:15 pm
by Angelo
I'm using x86-Version of PB 5.11 under Windows XP. Could it make the difference?
Re: LibZPlay wrapper (updated)
Posted: Wed Jul 10, 2013 7:21 pm
by erion
Hello,
LibZPlay should work under XP.
Just to be on the safe side, I assume you have everything in one directory, the dll, the include and the lib file.
If there is an example pb file in the libZPlay directory, could you try running that to see if you're having the linker error please?
Erion
Re: LibZPlay wrapper (updated)
Posted: Wed Jul 10, 2013 8:14 pm
by Angelo
Hi Erion,
I coded a mp3-player with many, many libzplay-functions (thanks again to you guys who made this wonderful include). For example, I implemented: setting of tempo, setting of volume, seek position, display of vu-data, determination of the audio length. It all works perfect.
Then I tried to write some kind of recording device. And at that point I needed the functions you added into the include. First I thought that I've set the parameters in e. g. zplay_SetWaveOutFile() wrongfully. But than I discovered that also other newly added functions which are more simple (like zplay_EnumerateWaveIn()) cause this linker error as well. What I'm saying is: It's surely not an obvious mistake. As you said: you have no problems for example with zplay_EnumerateWaveIn(). I have no explanation, why the new functions in your include do not work on my system.
P.S.
All the examples of yours and TS-Soft work well
Re: LibZPlay wrapper (updated)
Posted: Wed Jul 10, 2013 9:22 pm
by erion
Hi,
I have a strong suspicion that the lib file for the dll was not up to date in the version on my site. I have fixed the include with the two lines you've pointed out, and also included the patent-free version.
Please redownload and see if this works.
Oh, and congrats for your mp3 player!
Erion
Re: LibZPlay wrapper (updated)
Posted: Wed Jul 10, 2013 10:08 pm
by Angelo
Hi, Erion, I'm very grateful for your support. I appreciate it very much. I'll try tomorrow due to the fact that it's one hour to midnight (I live in Berlin), but certainly I will give you a feedback. I have the strong feeling that a solution for my problem is near. Good night und til tomorrow! - Angelo
Re: LibZPlay wrapper (updated)
Posted: Thu Jul 11, 2013 8:05 am
by Angelo
Hi, Erion!

Now all zplay-functions work without error!!!! You had the right suspicion: it was the libzplay.lib which caused trouble. Many thanks for the improved version!!
Now I can start to work on a recorder. By the way, do you have some experience in using libzplay for creating a recording software? Anyway, I'm looking forward to work on this - it'll be fun. - Angelo
Re: LibZPlay wrapper (updated)
Posted: Thu Jul 11, 2013 9:25 am
by erion
Hello,
You're welcome, I'm glad it worked!
Unfortunately I have no LibZPlay experience, but one can always learn
According to the help file the library has some limitations when it comes to enumerating/setting devices under Vista and higher. This may or may not be a problem for you!
Best of luck,
Erion
Re: LibZPlay wrapper (updated)
Posted: Tue Jul 23, 2013 1:26 am
by Poshu
Hey, I've got a problem: if I call a zplay function from inside a procedure, I get an IMA when exiting the said procedure...
Code: Select all
EnableExplicit
XIncludeFile "libzplay.pbi"
Global hZPlay, File.s, Text.s
Define ID3.TID3Info
Procedure Test(File.s)
Protected ID3.TID3Info
If zplay_OpenFile(hZPlay, File, #sfAutodetect)
If zplay_LoadFileID3W(hZPlay, File,#sfAutodetect, #id3Version2, @ID3)
zplay_Play(hZPlay)
Text = "Title: " + id3\Title + #LF$
Text + "from album: " + id3\Album + #LF$
Text + "from year: " + id3\Year + #LF$ + #LF$
Text + "Press okay to stop music"
MessageRequester("Test libzplay", Text)
zplay_Close(hZPlay)
EndIf
EndIf
EndProcedure
File = OpenFileRequester("Please select a ogg-file", "*.*", "ogg-File|*.*", 0)
If File
hZPlay = CreateZPlay()
If hZPlay
Test(File)
EndIf
zplay_DestroyZPlay(hZPlay)
EndIf
IMA should happen as soon as you press the "ok" button. (tested on pb5.11 32bit)
any help?
Re: LibZPlay wrapper (updated)
Posted: Tue Jul 23, 2013 8:16 am
by erion
Hello,
It seems that LibZPlay is unable to free a protected variable. I am not sure why this is happening, in theory it should work.
If you define ID3 as a global variable, the IMA does not happen.
Erion