blitzbasic

Author Topic: Odd PlaySound with volume  (Read 1082 times)

Offline Wampus

  • Prof. Inline
  • *****
  • Posts: 947
    • View Profile
Re: Odd PlaySound with volume
« Reply #15 on: 2011-Jan-16 »
Yeh, there seems to be some sort of exponential fall off rather than linear progression! After testing on my iPod I can confirm that both PLAYSOUND and PLAYMUSIC work as expected so no adjusting is needed there. On the PC though I get those strange values. I tested on three PCs and got 3 ever so slightly different results but a general pattern did emerge.

I've attached the little proggy I mentioned yesterday to this thread. Probably won't be of much use unless you want to see if your PC matches to similar values. The generated sound is a horrible square wave that I created in a hex editor rather than a sound program so be aware that your ears may bleed! To measure the output I used a output jack from the source PC and plugged the other end into the microphone jack on another PC then used a simple vu meter program from here: http://robotplanet.dk/knef/vumeter/

BTW I finally settled on these values as what I'm going to use for PC PLAYSOUND volume control for now:-

Volume    - -    Equivalent PLAYSOUND volume setting
100%1.0
90%0.99
80%0.98
70%0.96
60%0.95
50%0.93
40%0.91
30%0.89
20%0.86
10%0.8

« Last Edit: 2011-Jan-16 by Ragaril »

Offline Dabz

  • Mr. Polyvector
  • ***
  • Posts: 103
    • View Profile
    • BambooCoder
Re: Odd PlaySound with volume
« Reply #16 on: 2011-Jan-16 »
I've bunged this in the bug reports section, because obviously something is wrong (Tried it on two PC's now)

Dabz

Offline Hemlos

  • To boldy go where no pixel has gone before.
  • Global Moderator
  • Prof. Inline
  • ****
  • Posts: 1399
  • Gone Fishin'!
    • View Profile
    • Silver Volumetric Software
Re: Odd PlaySound with volume
« Reply #17 on: 2011-Jan-20 »
70% volume results in almost inaudible sound.
Windows xp here.
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

http://silver.binhoster.com/

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *****
  • Posts: 10297
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Odd PlaySound with volume
« Reply #18 on: 2011-Jan-21 »
instead of "MUSICVOLUME x" try "MUSICVOLUME (POW(x,  2.7182818285))" - does that sound better?
I'll include that in the engine then. The problem is, the ear is not working linear, but exponentially.

Offline Hemlos

  • To boldy go where no pixel has gone before.
  • Global Moderator
  • Prof. Inline
  • ****
  • Posts: 1399
  • Gone Fishin'!
    • View Profile
    • Silver Volumetric Software
Re: Odd PlaySound with volume
« Reply #19 on: 2011-Jan-23 »
I thought it was just my ear not working  :S
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

http://silver.binhoster.com/

Offline Dabz

  • Mr. Polyvector
  • ***
  • Posts: 103
    • View Profile
    • BambooCoder
Re: Odd PlaySound with volume
« Reply #20 on: 2011-Jan-23 »
Quote
instead of "MUSICVOLUME x" try "MUSICVOLUME (POW(x,  2.7182818285))" - does that sound better?
I'll include that in the engine then. The problem is, the ear is not working linear, but exponentially.

MUSICVOLUME seems fine, its #volume in the PLAYSOUND parameter that seems to be the broken Kitty me auld fruit.

If that works, I'll just wait till you update the engine, as mentioned, it all seems fine on iOS! :)

Thanks for taking a look at it, much appreciated! ;)

Dabz

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *****
  • Posts: 10297
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Odd PlaySound with volume
« Reply #21 on: 2011-Jan-24 »
is the POW mehtod for playsound working then?

Offline spudgunjake

  • Mr. Drawsprite
  • **
  • Posts: 56
    • View Profile
Re: Odd PlaySound with volume
« Reply #22 on: 2011-Jan-24 »
I had problems with samples, but found out that its was some codex on my pc, I uninstalled what I coould find and just have VLC player and media player installed, and it worked fine. I very careful what codex i use, I install ogg codex for windows this morning and my apt some times crashes.  just sures you what can happen.

Offline Dabz

  • Mr. Polyvector
  • ***
  • Posts: 103
    • View Profile
    • BambooCoder
Re: Odd PlaySound with volume
« Reply #23 on: 2011-Jan-24 »
Code: GLBasic [Select]
soundVol# = POW(0.5,  2.7182818285)
LOCAL ch% = PLAYSOUND(menu_click%,0,soundVol#)
 

Nothing Kitty, not a whimper, even with it as soundVol# = POW(0.8,  2.7182818285), with 0.8 being audible when used without POW!

Quote
I uninstalled what I coould find and just have VLC player and media player installed, and it worked fine.

Well, thats all well and good, and indeed a fix then, but alas, no good if your planning to sell your game... No customer is gonna want a faff like that, some of them can barely open a zip file never mind fannying on with codecs! :D

Dabz