glad you liked it :thumbup:
I'll modify to show the item image also, but not now, later, I'm working in a new sound system for priston tale, get rid of those crappy WAV files...
Printable View
glad you liked it :thumbup:
I'll modify to show the item image also, but not now, later, I'm working in a new sound system for priston tale, get rid of those crappy WAV files...
--- OT
Spoiler:
---- Thread
I dunno ur skills in PHP sungam3d, but a tip:
create a new <tr> or <td> in ur table ( I hate tables, i dunno whats a tr or whats a td, I just know tr comes first :lol: ), and make a <img> tag, but as src you make something like:
src="image/$item.jpg" which the $item variable MUST be the same which keeps the item code. there should be some variable that keeps the item code in that script, if there is not, and if you couldnt add it, I will help you np.
yeees, thats what I was talking about :thumbup:
@edit
Just editing, I was able to play for a while the Intro.xxx directly from my dll =DD
new format is working, but as I patched the whole routine, when I minimized the game it stopped playing at all, never returned, unless I restarted the game, but its already a start, isnt it? :lol:
just going to work in that. there is a considerable improvement in the sound quality.
oops, fixed, just a little noob error here:
pDSB->Play(0,0,DSBPLAY_LOOPING);
=p
now I have to make it stop playing when I select the gameserver and start playing the char selection bgm -,- omg, headache continue tomorrow lolol
It will support 5.1 sound system? :)
You rewriting it from wav to?...I hope flac!
It will support whatever DirectSound8 supports.
I prefer not to tell atm, and no, it is not flac =p
Why? DirectSound supports Flac with COREFlac. :wink:
Actually, DirectSound doesn't support much other than shitty WMA, and that isn't even good at WM9. :S
But it does support a very good plug-in system for codecs. Most people install AC3, MP3, MP2, OGG etc when they add a new media player or get DivX or such, and don't even realise it. ^_^
FLAC is excessive IMHO. The WAV files are pretty crappy to begin with. I was hoping to replace the music with decent quality s3m / xm files. I even started re-writing the opening music as a mod... but... I couldn't find the right kind of choir and orchestra instruments. :\ It's not really my thing anyway, I was over-reaching there really. But MP3 / MP4 / AAC / OGG etc all worked fine with the set-up I made.
I'm sure Sheen will do at least as well, and may even remember to document as he goes. >_<
its "impossible" to reproduce MP3 files using DSOUND =/
from what I read over the net, I have to decompress the MP3 file and then just sound->CreateBuffer() to play it.
but seems that I have to pay to add that in my program, so there isnt much free info available of it. they advise to use DSHOW to play mp3 files, but I think its not worth to rewrite everything to DSHOW, because there is a lot of "free" formats with equivalent quality, and easy enough to reproduce in dsound.
and yes, I am documenting everything XD
Well, DirectShow is well documented and it's filter graphs are surprisingly easy to program very complex systems in. Hence why most Windows media-player programs use it. (MPC-HC, ZoomPlayer, BS-Player, Nero ShowTime, PowerDVD etc. not mentioning Movie Maker, Windows Media Player and Windows Media Centre which come with the OS)
The Motion Picture Encoding Group do indeed hold a patent on the mpeg, mp3 and mp4 compression standards, requiring implementations to pay to register their implementation with them and keep records of exactly how many users are using their implementation in what geographical locations. But this legal requirement is stupid and unimplementable.
Open Source implementations like Lame and ffmpeg are licensed such that you cannot (legally) distribute compiled executable versions... but VLC, XMMS and MPlayer all include one or the other (if not both) implementations and are distributed in binary form free of charge. You can also download stand-alone binaries of both for Windows as a command line encoder / decoder or as a DLL for use in other applications. (in addition to ActiveX and DirectShow codecs like FFDShow, XviD and so on)
Again, the same applies to open source implementations of OGG and LAME (as well as APE and others) but neither of those have any legal patenting. :D: AC3 is, of course, patented by Dolby, but there are still Open Source implementations of this such as HeadAch3. (HE-AC3)
I might sound silly but whats the profit from using mp3?
I can see only one... size.
I'm not sure if mp3 did not had some complicated license, when you selling game you need to pay some $$$ to creators? This might be a bit illegal with what we doing.
But back to right track, waves are native part of windows, the don't lose quality also friend telling me that they are better for short sounds in games.
Correct me if I'm wrong but does size meter when come to music? Everything is played from buffer.
My point is... why use mp3?
___EDIT___
O!o!o! Make it play MIDI!
This will give some retro feel to this game ;)
atm, I would be glad if I could just play the entire song and not just the first few seconds XDDD
I cant solve that :(
---------- Post added at 08:30 PM ---------- Previous post was at 08:25 PM ----------
LMFAO
#define BUFSIZE 65536*10 // buffer length
to
#define BUFSIZE 65536*100 // buffer length
Solved LOLOLOLOLOLOL
I guess the buffer size should have the length of the file? or not?
I remember that wav files have a wider dynamic range ("space" between the quietest and the loudest sounds). For sounds with higher transients (cymbals and crashes for an example) and short sounds, most people use .wav . Mp3 have a less wide dynamic (a lot more compressed). Yes i agree using mp3 you would only gain some extra space, but, if you master it (using analog compressor when recording your music), i think you could 'emulate' a better quality up to some point (on an mp3, with some economy on the file size) ..
Size counts when it comes to quality of sound. When using an old-school Compander (compressor/expander (non-linear)) or an Expander (which 'expands' the dynamic range) and hearing (clean and well cared) Lp's , you can perceive the brutal increase of quality on sound (like on the old DBX expander ad, "you can hear each instrument of an orchestra!") in comparison to the digital thus compressed sounds..
@edit: But i don't think we need orchestra sound quality on pt (at least for now =D) mp3 , even with lots of compression wouldn't sound crappy i suppose.
Since the sounds of priston are most probably digital (not real instruments, etc..) i think if the user has the proper tones (or, if those MIDI commands were all organized to target waveforms in tiny but good .wav files) , using MIDI would surprisingly be better even than wav's . But then, you would have to sequence the midi files properly... =D
Not if you really want to profit from not using WAV files, no.
The reason I changed to mp3 / ogg or s3m was because I only keep two small buffers in memory, not the entire decompressed WAV.
Actually, I could have left the WAV on disk, and because I'm using buffered streaming, it still doesn't take up the entire files worth of memory when playing back. I can't remember how big the two buffers where now, but considerably smaller than the RAW PCM wave.
What actually caused me more difficulty, was trying to keep the short and simple sound effects completely in memory ready for instant playback. :lol:
Actually, it was pointed out to me that this eats CPU power when playing the game, but I found that my CPU hung up on PCI DMA requests from the disk less to an extent that more than negated this. ^_^
So... Yes Vormav, even a WAV should be streamed through buffers... but that isn't how PT works it. :lol: PT loads WAV files in memory at the same time it loads all the BMPs and TGAs for a particular map. :(: Boo, hiss. So it is profitable to replace the sound system, even if you choose to stick with WAV files.
You know I don't like to disable the existing "features" of PT, so the system I set up allowed you to store any particular sound in any particular format. You could use any one, or a mixture of formats... but as I say, I never got "effects" working properly, or (come to think of it) even the "ambient" Wind / Rain / Birdsong / Waves etc. (just so people know I'm not "hoarding" some awesome code to my self :wink:)
Again, my secret was to use Un4seen BASS. But early attempts showed that fmod (popular in everything from "casual games" to top titles like Bioshock and Crysis 2) was equally effective. :wink:
@bobsobol
I dont know how to put just a part of the ogg file into the buffer, since I am using the ov_read function...
you say about spliting the whole buffer into two small buffers?
With either BASS or fmod, you don't have to worry about the buffers, they are managed automatically. I spoke about handling audio buffers back in the 90s when I could be arsed (had to, since there weren't many decent wrappers) dealing with sound buffers on Amiga and DOS PCs with SoundBlaster. XD
I wouldn't do that now... there is too many very high quality free software libraries which will do it all for you.The decompression should work as a standard C / POSIX stream. If you weren't using a non-POSIX standard OS (Windows) the CRT would just allocate a FIFO from the OS, but since it is Windows, the CRT will create buffers, and manage them like a FIFO.Spoiler:
The audio buffers... IDK how DirectSound handles them, but I do know DirectShow objectifies a simulated "stream". (in simple words) You connect one filters producer (out pin) to another filters consumer. (in pin) It streams information through the connection when the filter graph is run. (Terminology may be off, I've played with this stuff, but didn't get very far studying it... again, I can just use the proceedural [C, not C++] headers for one of these wrappers and not have to tie my brain in knots with OOP shizzle :lol:)
well, I would be glad if I could just know how to use the SetVolume method lol
the parameter it takes, it is completely uknow to me, I've seen several threads discussing about it being a log10 function that I need to make to set the volume as a percentage from 0 to 100% e.g but its still not working.
Knowing this, I could easily make something like
F12 - Increase Volume
F11 - Decrease Volume
and use TextOutA to display that message to the player, like:
Volume: 50%
if anybody knows how to use that, and is willing to share, I would be grateful.
Hmm. Well, I'm used to having a Log() function available to me as part of the standard RTL, though I rarely have any need for it. So I'm not sure about the internal function.
I do know that most programs filter the buffer for Volume and stream mixing before passing them to DirectX... cleaver ones only mix in software to compensate for missing hardware channels, but if you have a normal 16-bit PCM stream in your buffer, then taking each 16-bit figure (sample) and dividing it by a percentage before asking DirectSound to play it. (or, at least the current buffer) ^_^
I could only notice a sound volume difference when I did
SetVolume(DBS_MAXVOLUME) or something like that.
but as you can see here, the parameter this function takes is strange.
IDirectSoundBuffer::SetVolume (Windows CE .NET 4.2)Quote:
The volume is specified in hundredths of decibels (dB). Allowable values are between DSBVOLUME_MAX (no attenuation) and DSBVOLUME_MIN (silence). These values are currently defined in Dsound.h as 0 and -10,000 respectively. The value DSBVOLUME_MAX represents the original, unadjusted volume of the stream. The value DSBVOLUME_MIN indicates an audio volume attenuated by 100 dB, which, for all practical purposes, is silence. Currently DirectSound does not support amplification.
Why are you looking up DirectSound APIs for Windows CE (Old Mobile phone devices) in .NET 4.2?
They aren't the same API parameters as Win32... usually. XDBut that's from an old DirectSound article on the MSDN, Only DirectX 9 seems to be documented now, and that method seems to have been dropped. :\Code:SetVolume (lpDS, DWORD dwVolume)
It's an arse to find anything useful on DirectX on the on-line MSDN though. I find most useful stuff seems to be in the SDK downloads.
well, my SetVolume method just takes one parameter as described in that site... I thouhg Windows CE was just an old kind of .net framework or stuff xD
well, if you can find any examples of how to use this function it would be nice, a link to a DX SDK documentation, IDK.
That's all on my main rig somewhere in a VM, and I don't think you can "link" to a specific page in the HelpText2 docs anyway. (Most annoying) But no, Windows CE was a "Compact Edition" designed for early Smart Phones and released at about the same time as ME (Millenium Edition). Unlike ME it has been progressively updated through the XP and into the Vista era, but most Windows phones are now running Windows Mobile, not CE. Just as you could put Windows ME on your brand new Windows 7 PC, if you are a phone company, you could still choose to buy Windows CE for your new SmartPhone... I just don't think it would sell that well. XD Phone companies are still shipping firmware updates to their older WinCE devices though.
well, I plan now to completely move to my DLL the entire sound system. I saw sandurr's dll and how he deals with classes, I think I'll start doing as he does. its better to save my variables indeed and keep the code clean aswell.
a little help of him would be nice too =p
just a tip of how to change the volume :blush:
Remember that PT uses DirectX 6.
That link to IDirectSoundBuffer::SetVolume on the MSDN website about Windows CE is pretty much the same DirectSound interface as the one that is used in PT (if not exactly the same). I can tell. PT uses the IDirectSound interface.
When DirectX 8 was released, it came with a new DirectSound interface which is the IDirectSound8 interface, but this is not used in PT.
If I remember correctly PT loads all sounds in one big array with IDirectSoundBuffer pointers in it. Like this:
Then somewhere in PT there is a global function that looks like this (perhaps its inline in PT, i dont know):Code:LPDIRECTSOUNDBUFFER bigarray[MAX_SOUNDS];
What you can do is find that function and replace it with your own, and remember the volume in a global variable:Code:void PlaySomeSound(int index)
{
bigarray[index]->Play(...);
}
I'm sure its a bit more complicated in PT but it comes down to that.Code:int g_volume;
void PlaySomeSound(int index)
{
bigarray[index]->SetVolume(g_volume);
bigarray[index]->Play(...);
}
but the g_volume must be between 0 and -10000 I think.
I wanted to make something like between 0% and 100%, like the volume bar of youtube, like windows itself, you know? :)
FFS.
x = 0 to -10000
y = (-x) / 100
Now y = your percentage. And if 0 is full volume and -10000 is mute then just 100 - y. XD
About sounds... there are some good composer music software for newbies (like myself) that with a few clicks u can make great songs very easily to change the whole BG music set (i like for that magix music maker, and there u can search for the sound banks )