Page 1 of 2
Sound3D (sound testing)
Posted: Mon Mar 03, 2014 10:54 am
by DK_PETER
Hey.
I just did a bug report (and removed it again) for Sound3D.
I'm in doubt, whether the problem is Sound3D or my 'ogg vorbis' soundfiles.
The helpfile states, that Sound3D support ogg and wav files, but they must be mono.
Are there other criterias for these sounds files kbps, etc....?
Using PB x86 for (Windows x64): I'm able to run the code below and play these
sound files 'link removed' without an ima...
With PB x64 (Windows): The code and sounds plays, but produces an ima on exit..
Could someone else please verify, that there is a problem or not? Might be something entirely else??
The problem is the SoundListenerLocate() command.
TIA
CODE:
Code: Select all
InitEngine3D()
InitSprite()
InitSound()
InitKeyboard()
Add3DArchive("snd", #PB_3DArchive_FileSystem)
Enumeration
#Window
#Camera
#Mesh
#Entity
#ParticleEmitter
EndEnumeration
OpenWindow(#Window, 0, 0, 800, 600, "ScreenTitle", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(#Window), 0, 0, WindowWidth(#Window), WindowHeight(#Window), 0, 0, 0)
CreateCamera(#Camera, 0, 0, 100, 100)
MoveCamera(#Camera, 10, 10, 10)
CameraLookAt(#Camera, 0, 0, 0)
If LoadSound3D(1, "el.ogg")
SoundVolume3D(1, 50)
SoundRange3D(1, 1, 500)
PlaySound3D(1, #PB_Sound3D_Loop)
EndIf
Quit.i = 0
Repeat
Repeat
ev = WindowEvent()
If ev = #PB_Event_CloseWindow
quit = 1
EndIf
Until ev = 0
SoundListenerLocate(CameraX(#Camera), CameraY(#Camera), CameraZ(#Camera)) ; The 'ear' follows the camera (this command is the problem in PureBasic x64)
RenderWorld()
FlipBuffers()
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Escape) Or Quit = 1
;Press escape and you'll get an invalid memory...
Re: Sound3D (sound testing)
Posted: Mon Mar 03, 2014 12:05 pm
by Thade
Just a side note on sound, generaly:
I ran into a problem last year with old games I made which had mono wav files on Windows 8 / 8.1
They were converted by Win8 to stereo while the program got loaded into memory (obviously a Win8 feature to show how helpful it is in making sound better) and therefore the programs which expected mono wavs did not run.
I had to convert them to mono ogg and the problem was solved.
.
Re: Sound3D (sound testing)
Posted: Mon Mar 03, 2014 6:39 pm
by DK_PETER
Thade wrote:Just a side note on sound, generaly:
I ran into a problem last year with old games I made which had mono wav files on Windows 8 / 8.1
They were converted by Win8 to stereo while the program got loaded into memory (obviously a Win8 feature to show how helpful it is in making sound better) and therefore the programs which expected mono wavs did not run.
I had to convert them to mono ogg and the problem was solved.
.
Hey Thade.
Thanks for your reply.
After some serious testing I can conclude, that my problem aren't my ogg files. They are all mono and are playing perfectly.
The problem seems solely related to PB x64 for Windows and the Sound3D. It produces an ima on exit no matter what I do.
I'm gonna try to solve the problem some more - before submitting a bug report, though I do believe, that there is a bug now.
Thanks for telling me about the Windows 8 auto convert for wav files...I didn't know that.

Re: Sound3D (sound testing)
Posted: Mon Mar 03, 2014 10:42 pm
by luis
el.ogg is stereo
Tested on PB 5.22 B1 x64 on Win7, no IMA with any of the three files.
Re: Sound3D (sound testing)
Posted: Mon Mar 03, 2014 11:15 pm
by DK_PETER
luis wrote:el.ogg is stereo
Tested on PB 5.22 B1 x64 on Win7, no IMA with any of the three files.
Thank you Luis for the test. Then the problem must be somewhere else...Will investigate further.
I've uninstalled - cleaned everything - reinstalled and retried. Still no go.
Re-encoded el.ogg and retried and I'm still getting an ima on exit in PB x64 (Windows 7 x64 Ultimate).
Mediaplayer classic (shipped with k-lite codec pack shows, that el.ogg is mono).
image removed..
Well...Though, I've created another solution, which doesn't involve Sound3D - I would definately like to know
what's causing the ima.
Anyway, thanks again.

Re: Sound3D (sound testing)
Posted: Mon Mar 03, 2014 11:27 pm
by luis
I'm sorry, here doesn't happen. That file looks stereo to anything I have here BTW, I opened with audacity and it loads two channels.
Anyway if the IMA happens with the other files too that should be irrelevant.
Re: Sound3D (sound testing)
Posted: Mon Mar 03, 2014 11:47 pm
by DK_PETER
@Luis
I believe, that Audacity automatically loads both channels - even if the file is in mono.
Here's what mediaplayer classic shows.
image removed...
Oh well...As I stated earlier...The problem must lie with me..somewhere

I'll figure it out sooner or later. Will try to do some updates and see if it helps..
Anyway. Thanks for testing. I appreciate it.
Re: Sound3D (sound testing)
Posted: Mon Mar 03, 2014 11:56 pm
by luis
DK_PETER wrote:
I believe, that Audacity automatically loads both channels - even if the file is in mono.
Nope, el2.ogg is loaded as mono, el.ogg as stereo.
The same with any program I have tried with: AIMP player, VLC, Spek (spectrum analyzer), etc.
They all agree.
I don't have MPC installed anymore, but I have MPC-HC (home cinema) -> "Audio: Vorbis 22050Hz stereo [Audio]"
Re: Sound3D (sound testing)
Posted: Tue Mar 04, 2014 12:08 am
by DK_PETER
@Luis
I believe you. If you download the snd.rar again, you'll notice that I've re-encoded the el.ogg file.
It is mono now.

Used an online converter the first time and it sucked bigtime. Didn't convert anything to mono.
Anyway...The ogg files doesn't matter. I don't believe that the problem is ogg file related anymore - and since
everything is running fine and dandy on your side, then something must be missing on my end.
Re: Sound3D (sound testing)
Posted: Tue Mar 04, 2014 12:14 am
by luis
Would be useful to know what are the dependencies of the 3D sound commands used by PB, maybe the K-Lite codec pack altered something ?
Did you install the 64 bit version of the codecs too ?
Just guessing, I don't know if that can be relevant.
Re: Sound3D (sound testing)
Posted: Tue Mar 04, 2014 12:35 am
by DK_PETER
Oooh yes...Knowing the dependencies would be quite useful

I did a codec update just now - didn't make any difference.
I didn't expect, that it would, but just to be on the safe side.
Again..Thank you for your time Luis.
If I solve the problem, I'll let you know.

Re: Sound3D (sound testing)
Posted: Tue Mar 04, 2014 11:15 am
by DK_PETER
An update...
No matter what I tried, I could not prevent PB X64 (Windows 7) from crashing on exit.
So..for the first time in years, I reformatted my drive and reinstalled a clean windows 7 64bit ultimate.
Updated drivers and installed basic applications only.
Installed PB 64bit and 32bit versions for Windows and tried again.
32bit runs everything flawlessly without producing an ima on exit.
64bit has a mind of its own and keeps on crashing with an ima on exit.
Since noone has the same problems as I do, I'll won't submit a bug report and
simply steer clear of PB's Sound3D() commands. (At least for 64bit).
Best regards
Re: Sound3D (sound testing)
Posted: Tue Mar 04, 2014 5:31 pm
by DK_PETER
Aaaaand now I've solved the problem!
Did some testing with the code in the first post on THREE different computers
with Windows 7 installed. All produces an ima using PB X64.
So...
Change the following two lines in the first post:
Code: Select all
OpenWindow(#Window, 0, 0, 800, 600, "ScreenTitle", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(#Window), 0, 0, WindowWidth(#Window), WindowHeight(#Window), 0, 0, 0)
Change to:
Code: Select all
OpenScreen(800,600, 32,"Unbelievable!",#PB_Screen_SmartSynchronization,60)
And the ima is completely gone! So Sound3D() works perfectly on PB X64 FullScreen.
Ta ta for now

Re: Sound3D (sound testing)
Posted: Tue Mar 04, 2014 5:40 pm
by luis
DK_PETER wrote: on THREE different computers with Windows 7 installed. All produces an ima using PB X64.
So it should happen to a lot of people, maybe no one beyond me really tested it ?
DK_PETER wrote:
And the ima is completely gone! So Sound3D() works perfectly on PB X64 FullScreen.
Works in FS and crashes if windowed ?
The three PC where you tested it, have they some relevant HW in common ? Video card brand ? Audio card ?
Re: Sound3D (sound testing)
Posted: Tue Mar 04, 2014 5:56 pm
by DK_PETER
So it should happen to a lot of people, maybe no one beyond me really tested it ?
Hehe!! I'm pretty sure, that guys interested in game development is a minority here.
DK_PETER wrote:
And the ima is completely gone! So Sound3D() works perfectly on PB X64 FullScreen.
Works in FS and crashes if windowed ?
Yep! Completely gone...No ima in FS. So now we're back to a bug...
The three PC where you tested it, have they some relevant HW in common ? Video card brand ? Audio card ?
[/quote]
All pcs are completely different.
PC1:
Windows 7 pro. 64bit
8 GB ram
GTX 570
X-fi sound card
PC2:
Windows 7 Ultimate 64bit
16 GB ram
GTX 770 4GB
X-fi sound card
PC3: HP PAVILLION
Windows 7 Pro 64 bit
8 GB RAM