The MASM Forum

Miscellaneous => Miscellaneous Projects => Topic started by: avcaballero on July 28, 2014, 06:25:24 AM

Title: tiny mci multimedia player
Post by: avcaballero on July 28, 2014, 06:25:24 AM
Hello. I'm trying to make a tiny mci multimedia player. This is the very-very-very first version though operative. You can open a midi-mp3-wav-etc file and then play it, also stop and reanude it, and can demand a looping play of it. At least en W7 works fine... more or less. I need to insert a beep at the end of the file to reanude it from the begining, need to fix it.

I want to implement it a basic ... don't know how to name it... graphic bar guided by the music?. One status bar (I think it is not so hard), and one volume bar (not hard neither). And an avi player (not hard). The more difficult could be the first one.

In short. Any info about that?

By the way, 512Kb of size is a bit low limit...  :redface:

Regards,
alfonso
Title: Re: tiny mci multimedia player
Post by: dedndave on July 28, 2014, 07:29:18 AM
you can probably just use a "slider" aka trackbar - somewhat similar to a scrollbar

http://msdn.microsoft.com/en-us/library/windows/desktop/bb760149%28v=vs.85%29.aspx (http://msdn.microsoft.com/en-us/library/windows/desktop/bb760149%28v=vs.85%29.aspx)

if you want to use CreateWindowEx, you can use the predefined system class:

szTrkBarClass   db 'msctls_trackbar32',0
Title: Re: tiny mci multimedia player
Post by: TouEnMasm on July 29, 2014, 02:13:26 AM
A very good one is VLC.His author said that he is good because he don't use API as you do.
http://msdn.microsoft.com/en-us/library/windows/desktop/ff819076(v=vs.85).aspx (http://msdn.microsoft.com/en-us/library/windows/desktop/ff819076(v=vs.85).aspx)
The mediaobj.h(.sdk) is part of the windows sdk
Perhaps wincodecsdk.h(.sdk) could help in this.
 
Title: Re: tiny mci multimedia player
Post by: Siekmanski on July 29, 2014, 05:55:46 AM
You need direct access to the audio buffer to create a sound bar or oscilloscope. Is this possible with the MCI api ?
You can do this if you use ACM-codecs.
Title: Re: tiny mci multimedia player
Post by: avcaballero on August 03, 2014, 10:14:58 PM
Hello, thank you all for your responses. I've been a few days on hollidays and didn't watch them. I've had few time to work on the program, but it already has several interesting features: we already know how long is the file we are playing and for what position we are, hence it would be easy to add a track bar.

In the other hand, it can play several formats, including films avi, you can check it. Also can play in a loop if you click in the 8th button (loop icon) or just one time if you click it once again.

Nevertheless, i have to control better when the file ends playing and polish many things.

Also, i'd like to add an oscilloscope bar, but this seems to be not so easy to implement, though this is a main point to me because, controlling this, can be used in demos for sincronizing graphics and sounds.

My objective is not to make a multimedia player in the usual way, just play a bit with sound programming.

I think that it is amazing you can make a simply (but functional) multimedia player in a few kilo bytes.

Regards
Title: Re: tiny mci multimedia player
Post by: dedndave on August 04, 2014, 03:05:29 AM
a spectrum analyzer would be a nice feature (rather than an oscilloscope)
i bet Marinus has some code for that   :t
Title: Re: tiny mci multimedia player
Post by: Siekmanski on August 04, 2014, 06:24:02 AM
Ever thought of using directsound ?
It's easy to set up and you have full control of the sounddata in the sound buffers.
With a bit of timing stuff you can draw a scope or whatever and synchronise graphics etc.

Lately i was busy programming a (ACM codec) mp3 player, wich is a pain in the a**. There are so many corrupt mp3 files that crashed my proggy.
So i made a little proggy to analyze the mp3 files to find the errors and correct them on the fly so they could play in my proggy or else skip the song.

It's fun to watch graphics that reacts to the music.  :biggrin:
Title: Re: tiny mci multimedia player
Post by: avcaballero on August 07, 2014, 04:53:06 PM
Hello. Track bars added but not fully functional, and any other minor changes.

Regards
Title: Re: tiny mci multimedia player
Post by: Gunther on August 07, 2014, 10:18:35 PM
Alfonso,

works fine under Windows 7-64. The language is Spanish, isn't it?

Gunther
Title: Re: tiny mci multimedia player
Post by: avcaballero on August 07, 2014, 10:55:18 PM
Yes, it is.

Flat buttons seem to be more stylish than 3d ones  :icon_rolleyes:
Title: Re: tiny mci multimedia player
Post by: FORTRANS on August 07, 2014, 11:17:17 PM
Hi,

   Works for MP3 and WAV files under Windows 2000.  An AVI
file opened, but did not play (I think).  Looks a bit odd though.
Attached is a screen shot of it.

Cheers,

Steve N.
Title: Re: tiny mci multimedia player
Post by: Siekmanski on August 08, 2014, 05:09:05 AM
Mp3 Wav and Avi play well under Windows 8.1 64 bit.
Title: Re: tiny mci multimedia player
Post by: avcaballero on August 08, 2014, 04:50:40 PM
My aim is to make a multimedia player as tiny as i can, doing the minimum win api calls, so i made icons using system fonts webdings and wingdings, but i can see that not everybody has them...  :biggrin: Systems fonts size can take effect too  :biggrin:

:( :redface: :(

One way to fix it should be using images, but this will increase the exe size...

The aspect of the window should be this one (didn't show the imagen in the zip???):

Thank you for your help,
alfonso
Title: Re: tiny mci multimedia player
Post by: sinsi on August 08, 2014, 05:58:02 PM
Playing so far: avi, wmv, wma, mp3, mp4, flv, aif
Windows 8.1 Pro with Media Center, also shark007's codec pack probably helps :biggrin:
Title: Re: tiny mci multimedia player
Post by: avcaballero on August 08, 2014, 06:30:41 PM
Thank you sinsi. Everybody sees the player as i attached before? I see that FORTRANS can not, maybe he has not any of the fonts used... It should be a pity to have using images instead of fonts, though only increases in 11 kb the size of the exe, maybe even less. :idea:

Regards
Title: Re: tiny mci multimedia player
Post by: Siekmanski on August 09, 2014, 05:06:33 AM
Same as attached picture here.
Title: Re: tiny mci multimedia player
Post by: avcaballero on August 11, 2014, 04:22:28 PM
Hello, some changes done

Now buttons work as expected: open, play/pause, stop, sequential/repeat, info. The others do nothing for now.

Tooltip changes in buttons with double function when is due, also in volume track bar.

Track bars work fine:
* status bar follows the playing position and you can interactuate with it for positioning the playing where you want.
* volume bar works fine, but the order to mci don't.

ToDo list:
* Add spectrum analyzer. Will we achieve to synchronize it with music?
* Add play list.
* Get into live buttons that for now don't work
* Make the file name oscillate in its field in status bar when doesn't fit
* Change font icons for image icons. It will increase in some kb the resulting size
* Polish the code.

Other:
* I have noticed that in some cases the file length returned by mci is not right
* It seems that mp3 are followed in milliseconds but films don't ???

Thank you all,
alfonso
Title: Re: tiny mci multimedia player
Post by: Siekmanski on August 11, 2014, 05:48:33 PM
Hi avcaballero,

Quote
ToDo list:
* Add spectrum analyzer. Will we achieve to synchronize it with music?

Is it possible to get access to the raw audio data with the MCI api?
Title: Re: tiny mci multimedia player
Post by: avcaballero on August 11, 2014, 06:00:31 PM
I don't know. I will try it
Title: Re: tiny mci multimedia player
Post by: farrier on August 12, 2014, 12:06:04 PM
It would be nice to see the source code for this player

A chance to educate!

tia,

farrier
Title: Re: tiny mci multimedia player
Post by: avcaballero on August 12, 2014, 04:40:34 PM
When i've finished what i'm doing.
Title: Re: tiny mci multimedia player
Post by: farrier on August 13, 2014, 06:08:48 AM
Beautiful!
Title: Re: tiny mci multimedia player
Post by: Gunther on August 13, 2014, 08:30:13 AM
Hi Alfonso,

Quote from: avcaballero on August 12, 2014, 04:40:34 PM
When i've finished what i'm doing.

that would be nice. You should perhaps it integrate in your tutorials. Only an idea.

Gunther
Title: Re: tiny mci multimedia player
Post by: avcaballero on August 13, 2014, 04:22:38 PM
That's the idea. A tuto on sound programming... phewww, much work. If everything works and have time. Does anyone want to participate? Here's a preview of the  spectrum analizer. Now "just" get it work.
Title: Re: tiny mci multimedia player
Post by: Siekmanski on August 13, 2014, 07:59:01 PM
Hi avcaballero,

If it's ok with you, i'll make a minimalistic example with an oscilloscope and a spectrum analyzer.
For that i'm gonna use DirectSound for the music and Direct3D9 for the graphics.
Did search for getting access via MCI to the raw audio data but, couldn't find anything.
To keep it simple, the program will load a .WAV file ( 16 bit, Stereo, 44100 sample rate )
Think i need a week or so to write it.....
Title: Re: tiny mci multimedia player
Post by: avcaballero on August 13, 2014, 08:25:58 PM
Yes, it's very ok to me. If you like, i will include into the tuto and credit you as the author with your nickname, or real name, what you want, otherwise it would be nice to me just for learn.

Source code would be nice, but even better if it is accompanied by some explained notes. Will your code be masm? When i have time, or anybody else who wants, would translate it to nasmx/fasm/tinyc.

My aim is to make a tuto on sound, in the whole as i can, ie, midi, wavs, mp3, etc with differents ways of playing them (not only mci, but direct sound, playsound, etc, revive old dos crappy sounds, etc). This will require threads. I'd like to write code to play mods/xm, in a simply way, just for play them in demos/games.

Very important, synchronizing sounds and graphics.

I don't have previous experience with none of them, i'm learning as i a program.

So, very much things to do, so if any one want to contribute with code/explanation would be welcome.

Regards.
Title: Re: tiny mci multimedia player
Post by: Siekmanski on August 13, 2014, 09:24:13 PM
Yes, it will be written in MASM.
The sound data will be converted to a 32 bit floating point sound buffer so we can do some fast SIMD coding.
For the spectrum analyzer i'll use FIR bandpass filters for each frequency band we want to show on the screen.
The graphics will be synchronized to the screen refresh rate and the sound playing at that moment.
I'll try to keep it as simple as possible ( no fancy speed tricks etc.... )

Marinus
Title: Re: tiny mci multimedia player
Post by: Siekmanski on August 14, 2014, 11:02:53 AM
Hi avcaballero,

Just found an old ( very bad ) modplayer routine on my old harddisk.
This was an attempt to make a Protracker the same as on the Amiga.  :biggrin:
Never finished it......

click on "disk op." to load a mod file, and then play
Title: Re: tiny mci multimedia player
Post by: Gunther on August 14, 2014, 11:53:41 AM
Alfonso,

the spectrum analizer looks good.

Marinus

Quote from: Siekmanski on August 14, 2014, 11:02:53 AM
Just found an old ( very bad ) modplayer routine on my old harddisk.
This was an attempt to make a Protracker the same as on the Amiga.  :biggrin:
Never finished it......

click on "disk op." to load a mod file, and then play

works with Windows 7-64 and my High Definition AMD Audio Device. Why haven't you finished the software? By the way, the wasteland file sounds very TECHNO. Only for strong nerves.  :lol: :lol: :lol:

Gunther
Title: Re: tiny mci multimedia player
Post by: Siekmanski on August 14, 2014, 07:20:53 PM
Hi Gunther,

QuoteWhy haven't you finished the software? By the way, the wasteland file sounds very TECHNO. Only for strong nerves. :lol: :lol: :lol:

Maybe i'll pick it up some day......
The wasteland mod was made by a german demo group called "Red Sector" in 1989, they had strong nerves. :lol: :lol: :lol:
Title: Re: tiny mci multimedia player
Post by: Gunther on August 14, 2014, 10:43:08 PM
Marinus,

Quote from: Siekmanski on August 14, 2014, 07:20:53 PM
Maybe i'll pick it up some day......

you should do that.

Quote from: Siekmanski on August 14, 2014, 07:20:53 PM
The wasteland mod was made by a german demo group called "Red Sector" in 1989, they had strong nerves. :lol: :lol: :lol:

That's pretty old. I didn't know that.

Gunther
Title: Re: tiny mci multimedia player
Post by: avcaballero on August 15, 2014, 01:17:32 AM
Thank you, Marinus, very valuable example :t.... I've got "Unable to create Direct3D Object" though.
Quote from: Gunther on August 14, 2014, 11:53:41 AM
the wasteland file sounds very TECHNO
Aaaaahhh, techno, thats good for me :biggrin:

In this version, volume track bar works fine.

Regards
Title: Re: tiny mci multimedia player
Post by: GoneFishing on August 15, 2014, 02:44:45 AM
Quote from: avcaballero on August 15, 2014, 01:17:32 AM
Thank you, Marinus, very valuable example :t.... I've got "Unable to create Direct3D Object" though.
Check the dependencies , some DX DLLs may be missing from your computer.
Title: Re: tiny mci multimedia player
Post by: avcaballero on August 18, 2014, 01:17:29 AM
I cheated. Spectrum works... randomly, not with the music  :biggrin:

I've been playing a bit with this and i think that FFT is needed, that wouldn't be the problem in principle. To implement this formula we need to know samples, i guess that samples per second. I believe that we can retrieve this information from mci using "status" with a string like this:
 
  status mymci audio samplespersec notify
 
But i'm not sure, the prooves that i made give me values such as 16,776,960. Would we need to divide it by 1000?

FFT seems to be a bit slow, and when i have used it every second, the program crashed after a while. Maybe would be needed creating a thread to calculate this, and maybe not every second... ?

Any idea?
Thank you
Title: Re: tiny mci multimedia player
Post by: dedndave on August 18, 2014, 03:00:59 AM
i would try to aim for 4, 8, or maybe even 16 updates per second
Title: Re: tiny mci multimedia player
Post by: Siekmanski on August 18, 2014, 05:08:45 AM
Just synchronize to the screen refresh rate.
Let's say you have a screen refresh rate of 60 Hz and play the music at a sample rate of 44100 Hz.
Then you have 44100 / 60 = 735 audio samples per frame to use with your spectrum.
Now trigger the screen update and calculate the position in the audio buffer.

Important is to use all samples to present a full spectrum.

If you want to use FFT then you can cheat and do a 512 samples FFT discarding the remaining 223 samples.
You will lose spectrum information...
Or you do a 1024 samples FFT and fill it with the 735 audio samples and 289 null samples.
Now you get the full spectrum information out of the 735 audio samples.

Because the audio data stream is continue, it is not important how often you present your spectrum to the screen.
for example 30 times a second, then you have to process 1470 audio samples at once.

Alfonso, did you find a way to get access to the MCI audio buffer?

B.T.W. there are many ways to show the frequency spectrum.

for example: FFT DFT Goertzel IIR
And the FIR method i'm working on now. ( need a couple of more days to complete it )
Title: Re: tiny mci multimedia player
Post by: avcaballero on August 18, 2014, 04:37:26 PM
Quote from: Siekmanski on August 18, 2014, 05:08:45 AM
Alfonso, did you find a way to get access to the MCI audio buffer?
No. I'm studying MCI documentation and proving. There're many labels, much stuff, but poorly documented and very few resources in the net.

As i said before, it is possible that "status" mci command with some of its labels may help us, but i need prove.

Quote from: Siekmanski on August 18, 2014, 05:08:45 AM
And the FIR method i'm working on now. ( need a couple of more days to complete it )
I'm waiting for it :t

Regards
Title: Re: tiny mci multimedia player
Post by: Siekmanski on August 20, 2014, 11:28:30 AM
Hi avcabalero,

This is how far i am now...
Wrote a timer interrupt which polls every 5 milliseconds the play cursor of the soundcard.
It's a double buffer system, 1 buffer is playing while the other buffer is filled with new audio data.
Fast sample type conversion from 16bit signed to float32 and vice versa is done with SSE2.
Drawing to the screen is done with Direct3D9 vertex programming.
As you can see i synchronized the audio that is playing with the oscilloscope on the screen.
You can load 44100 Hz 16bit stereo music wav files to test it.
In the attachment is a little wav sample.

This weekend i planned to implement the FIR audio spectrum analyzer.
When it's finished i will include all the source codes with some comments how things are done.

Marinus
Title: Re: tiny mci multimedia player
Post by: avcaballero on August 20, 2014, 04:52:43 PM
It has an excellent look, Marinus. I'm going a bit slowly, but keep on going and hope to have some news soon.

Thanks a lot.
Alfonso
Title: Re: tiny mci multimedia player
Post by: Gunther on August 20, 2014, 11:08:25 PM
Hi Marinus,

looks good.  :t

Gunther
Title: Re: tiny mci multimedia player
Post by: dedndave on August 21, 2014, 01:32:45 AM
that looks more like an oscilloscope   :biggrin:
Title: Re: tiny mci multimedia player
Post by: dedndave on August 21, 2014, 01:45:20 AM
some spectrum analyzer pics...

this is what a portion of the radio spectrum might look like (animated GIF)

(http://www.bitscope.com/software/dso/guide/2.5/115.gif)
http://www.bitscope.com/software/dso/guide/2.5/115.gif (http://www.bitscope.com/software/dso/guide/2.5/115.gif)

for this application, it might look like this
the different "bands" could coincide with graphic equalizer bands (also an animated GIF)

(http://www.animated-gifs.eu/avatars-100x100-music/0259.gif)
http://www.animated-gifs.eu/avatars-100x100-music/0259.gif (http://www.animated-gifs.eu/avatars-100x100-music/0259.gif)

this one demonstrates a sort of power-density graph (another animated GIF)
in RF and microwave work, we often use a storage display (CRT with very long persistance)

(http://www.metageek.net/wp-content/uploads/2011/02/density-real-time.gif)
http://www.metageek.net/wp-content/uploads/2011/02/density-real-time.gif (http://www.metageek.net/wp-content/uploads/2011/02/density-real-time.gif)

this is an add-on for TotalRecorder for spectral display/graphic EQ

http://www.totalrecorder.com/addon1.htm (http://www.totalrecorder.com/addon1.htm)
Title: Re: tiny mci multimedia player
Post by: Gunther on August 21, 2014, 01:49:41 AM
Dave,

excuse me, but an oscilloscope looks a bit different.  :lol:

Gunther
Title: Re: tiny mci multimedia player
Post by: Siekmanski on August 21, 2014, 02:02:27 AM
Thanks Alfonso and Gunther.

Hi Dave,

Quotethat looks more like an oscilloscope   :biggrin:
Yes, but what's a spectrum analyzer without an oscilloscope.   :biggrin:   :biggrin:
The spectrum analyzer will be below the oscilloscope, in this case just as in Alfonso's request a 10 bar 1 octave pass band filter.
This weekend i hope to have it finnished.

Marinus
Title: Re: tiny mci multimedia player
Post by: dedndave on August 21, 2014, 02:02:37 AM
i have some idea what an oscilloscope looks like - lol
sometimes, i feel like i have one attached to my hip

a couple of the images above show linear divisions for frequency
for RF work, that's usually desirable (we want the sidebands to appear linear)
but, the audio spectrum might be best divided into log divisions
each band doesn't have to be an octave

let's say we want to cover 2 to 20,000 Hz in 12 bands
the width for each would be (20000/2)1/12 = 2.1544346900318837217592935665194

so, the bands would be
2 to 4.309 Hz
4.309 to 9.283 Hz
9.283 to 20 Hz
20 to 43.09 Hz
43.09 to 92.83 Hz
92.83 to 200 Hz
200 to 430.9 Hz
430.9 to 928.3 Hz
928.3 to 2000 Hz
2 to 4.309 KHz
4.309 to 9.283 KHz
9.283 to 20 KHz

probably, 20 to 20,000 is more common - i'll let you do the math   :P

the vertical scale is also log (decibels)
Title: Re: tiny mci multimedia player
Post by: Gunther on August 21, 2014, 05:12:37 AM
Dave,

Quote from: dedndave on August 21, 2014, 02:02:37 AM
probably, 20 to 20,000 is more common - i'll let you do the math   :P

why not using Abacus 2.0? Are you to lazy?  :lol: :lol: :lol:

Gunther
Title: Re: tiny mci multimedia player
Post by: dedndave on August 21, 2014, 05:16:29 AM
intrinsics are very time-consuming on an abacus - lol
Title: Re: tiny mci multimedia player
Post by: Gunther on August 21, 2014, 05:54:48 AM
Quote from: dedndave on August 21, 2014, 05:16:29 AM
intrinsics are very time-consuming on an abacus - lol

That's interesting. I didn't know that. So; I've to update my model.

Gunther
Title: Re: tiny mci multimedia player
Post by: avcaballero on August 24, 2014, 10:41:53 PM
Hello, here's my source code. I didn't achieve get the spectrum analyzer work yet.

What i have tried is the next:

* Line 225. [call      WaveIn_Inicio]
Open de waveIn device to retrieve wave data from whatever the kind of music that mci were playing

* Line 300. [CreateThread RecogeWaveData]
In the TrimSpectrum timer we execute the recovering wave data that has the next subroutines:
  - WaveIn_Rellena. Retrieves wave data from the device opened. This is the heart of the though, but is too slow and no effective. Commented, but it is needed to get it working.
  - doFFT2. What the name says, second version.
  - clcLongBarrasEspectro. Calculates the length of the spectrum analyzer. This data will go to the vbEspectro array. Ten fields of byte values (16 maximum).
 
I have no much time to work on it, so any help would be nice :). I think that i'm near, but the waveIn device seems to be too slow, there must be another way or something to makes it work.

Regards
Title: Re: tiny mci multimedia player
Post by: Gunther on August 25, 2014, 08:38:23 AM
Thank you Alfonso.  :t

Gunther
Title: Re: tiny mci multimedia player
Post by: avcaballero on August 25, 2014, 04:29:29 PM
I have fixed a couple of things, now i don't allow start filling the wavein buffer before it has been filled plenty before. The motion of the spectrum analyzer bars are due now to the wave in device. Surely they needed to apply some reduction factor, i don't worry about that. The main problem is that the wavein buffer is filled up very slowly. I can't believe it, there must be anything wrong.

In the other hand, i believe that there's a rawdata label for mci command. Other land to explore...

Regards
Title: Re: tiny mci multimedia player
Post by: guga on August 25, 2014, 08:08:23 PM
Hi Alfonso,

take a look at the source code of the directX of UFMod here: http://ufmod.sourceforge.net

It don´t seems to be that hard to port and it works as expected. Maybe it can help you fix on your own Bars (The example on dx uses only 2 channles of audio, but the filling of the bitmaps for them are simply gdi usage).

The functions that you may use are:
FillVUBars
RedrawVU
RedrawTimeP

All inside play_ds.c
Title: Re: tiny mci multimedia player
Post by: avcaballero on August 25, 2014, 09:52:39 PM
Thank you, guga, i'll have a look, though i first wanted to make mci working, ufmod surely read directly from file, and i don't know yet if mci offers that lovely feature  ::) . When i have finished what i want to do/learn with mci i will start with directx/maybe external dlls like ufmod or others.

Regards.
Title: Re: tiny mci multimedia player
Post by: guga on August 25, 2014, 10:29:05 PM
I`m currently also working on UFMod. Although it can be assembled in Masm as it is, the library is deeply confused. But, it works for mci as well (not only dx or openAI). It was biased on FMod, but the russian author is really insane :icon_mrgreen: :icon_mrgreen:

I´m trying to port it as a dll (or as a library, if i suceed to convert to RosAsm and later convert it to masm with JJ tool RosAsm2Masm) and fixing whatever i can be able to understand from that. But, if you plan to rewrite the asm version of UfMod, get ready, because  it is a pain to do.
Title: Re: tiny mci multimedia player
Post by: avcaballero on August 25, 2014, 11:40:30 PM
Quote from: guga on August 25, 2014, 10:29:05 PM
if you plan to rewrite the asm version of UfMod, get ready, because  it is a pain to do.
Yes, I'm afraid so :biggrin:, i'll settle with a few things
Title: Re: tiny mci multimedia player
Post by: avcaballero on August 26, 2014, 04:23:24 PM
Hello there, i noticed yesterday that the process of my program wasted many resources... hmmm a bit strange. What i want so many data for at the same time? Now, spectrum analyzer works fluently using wavein device inside some logical values. Nevertheless the bars motion appears to be a bit chaotic yet, i think that i have to calibrate the fft function. We will see...

Regards
Title: Re: tiny mci multimedia player
Post by: guga on August 26, 2014, 06:26:41 PM
Great work.

But, the spectrum analyser is static here in WinXp. I mean, the bars shows up, but don´t move
Title: Re: tiny mci multimedia player
Post by: avcaballero on August 26, 2014, 07:13:50 PM
 :biggrin: that's another history. You have to set the wave in device activated, as you want to talk to microphone. Ie, it is a little fudge for not to have reading directly from the audio file. Maybe would be possible to do a bypass directly to the WaveIn device, but I haven't got such high expectations, for the moment I settle for get it working.
Title: Re: tiny mci multimedia player
Post by: Gunther on August 27, 2014, 02:07:38 AM
Well done, Alfonso.  :t

Gunther
Title: Re: tiny mci multimedia player
Post by: Siekmanski on September 01, 2014, 08:13:14 AM
It took me a bit longer to write, sorry Alfonso.
But i have rewritten everything to make things more flexible.
Also included a fresh written routine to calculate the FIR coefficients for low pass, high pass, band pass and band reject filters with a Hamming window.
Very handy timing routines and fast sample type conversion routines.
I'll comment and explain as much as possible and rename labels and text from Dutch to English.  :biggrin:
When i'm ready i will post all the source code and maybe open a new thread to explain some stuff if you guys are interested.
I know that there are other ways to do spectrum analyzers but you can do a lot of nice things with FIR filters.

Here is the exe with a 1 octave 10 band analyzer and 2 short wav samples.
Just load your favorite wav file and enjoy watching the music.  :eusa_dance:
There is maybe 1 thing of which i'm not certain, that is the Direct3d9 code.
I've kept it very minimal so i hope it works on other PC as well.
You will need at least a PC with SSE2 ( didn't include a test.... )

Title: Re: tiny mci multimedia player
Post by: guga on September 01, 2014, 03:36:34 PM
Excelent work Siekmanski
Title: Re: tiny mci multimedia player
Post by: avcaballero on September 01, 2014, 05:33:28 PM
Thank you Marinus. I'm a bit lazy lately. I have discovered Games of Thrones and I'm catching up, I'm going now for the second sesason. I'm waiting for your code. :t
Quote from: Siekmanski on September 01, 2014, 08:13:14 AM
and rename labels and text from Dutch to English.  :biggrin:
Fortunately, because Dutch is a bit hard for me :biggrin: Hmmm... and English too  :bgrin:
Title: Re: tiny mci multimedia player
Post by: Gunther on September 01, 2014, 09:49:56 PM
Good work, Marinus.  :t

Gunther
Title: Re: tiny mci multimedia player
Post by: Siekmanski on September 02, 2014, 09:49:08 AM
Thanks guys.

Alfonso, no troubles now with Direct3D9 as you had with the protracker example?
Title: Re: tiny mci multimedia player
Post by: avcaballero on September 02, 2014, 04:26:41 PM
I had problems with it in a WXP in an internet parlor, but works fine in my w7.
Title: Re: tiny mci multimedia player
Post by: Gunther on September 03, 2014, 02:19:40 AM
Hi Alfonso,

Quote from: avcaballero on September 02, 2014, 04:26:41 PM
I had problems with it in a WXP in an internet parlor, but works fine in my w7.

that's unclear. Why makes it problems under XP?

Gunther
Title: Re: tiny mci multimedia player
Post by: avcaballero on September 03, 2014, 04:31:43 PM
Hello, Gunther. I don't remember exactly the error message. It was relative to Direct3D and the application never showed up. I will go there again some day and prove again. Does it work fine for everybody else in WXP? Maybe any library missed in those pc. I will check it in an vb xp...

It seems that standard wxp needs extra libraries.


Regards
Title: Re: tiny mci multimedia player
Post by: Gunther on September 03, 2014, 06:21:50 PM
Alfonso,

I'll test it tomorrow with my old Win XP configuration. I'll let you know how it works.

Gunther
Title: Re: tiny mci multimedia player
Post by: Siekmanski on September 03, 2014, 06:58:01 PM
You only need  "d3d9.dll" for this proggy . It uses only the standard installed directX9.
Title: Re: tiny mci multimedia player
Post by: Gunther on September 03, 2014, 09:45:08 PM
Hi Marinus,

Quote from: Siekmanski on September 03, 2014, 06:58:01 PM
You only need  "d3d9.dll" for this proggy . It uses only the standard installed directX9.

interesting. Thank you for the information.  :t

Gunther
Title: Re: tiny mci multimedia player
Post by: avcaballero on October 22, 2014, 06:42:30 PM
Hello, this is the new version, i think it works quite well now. But, of course, we need to turn on the wave-in device to get the wave format of what we are playing. Hence, i wonder if it is possible making it work regardless of it is on or off to obtain this precious wave info.

Regards
Title: Re: tiny mci multimedia player
Post by: Gunther on October 22, 2014, 09:42:39 PM
Alfonso,

what's the reason for the new version? Bug fixes?

Gunther
Title: Re: tiny mci multimedia player
Post by: avcaballero on October 22, 2014, 10:09:39 PM
No, in previous versions, spectrum analyzer didn't work well, ie at the rhythm of music. Now you can notice that bars move according to music, more visible when goes from top to down and vice versa.

Previously, when music was ending and sound was down, bars was up. Now, i believe that bars works better.

The hard thing to do is using wave-in device even if it were off, or use any other way to get the wave info.

Regards.
Title: Re: tiny mci multimedia player
Post by: Gunther on October 22, 2014, 10:30:02 PM
Works fine under Windows 7-64.

Gunther
Title: Re: tiny mci multimedia player
Post by: Siekmanski on October 23, 2014, 12:58:35 AM
works on win 8.1 64 bit.
Title: Re: tiny mci multimedia player
Post by: Gunther on October 23, 2014, 02:33:16 AM
Also tested with Windows 8-64. Works fine.  :t

Gunther
Title: Re: tiny mci multimedia player
Post by: avcaballero on October 23, 2014, 06:38:35 PM
Well, vb is a great data source, so, I asked this matter (http://www.vbforums.com/showthread.php?779087-Using-wave-in-device&p=4776447#post4776447) in a vb forum and the answer was what I afraid, investigating and hacking the api call (more work) but I'll take the end of the Navition's response, that is what I need: "WaveIn is easy".

Nevertheless, the best was a few down a vb source code from Nightwalker83 with very nice looking.

Regards
Title: Re: tiny mci multimedia player
Post by: Gunther on October 23, 2014, 10:39:48 PM
Hi Alfonso,

Quote from: avcaballero on October 23, 2014, 06:38:35 PM
Well, vb is a great data source, so, I asked this matter (http://www.vbforums.com/showthread.php?779087-Using-wave-in-device&p=4776447#post4776447) in a vb forum and the answer was what I afraid, investigating and hacking the api call (more work) but I'll take the end of the Navition's response, that is what I need: "WaveIn is easy".

the members of the VB forum seems to be very active. An interesting place.

Gunther