hieurl's world

MCI?

Posted in Nara audio player, Projects by Hieu T. Luong on May 17, 2010

After doing some searching with Google about the method to play an audio file on Windows, most of the returned result are about the Microsoft’s Multimedia Control Interface, calling the function PlaySound() of that library.
But it’s just playing, and there are still a lot to handle, including volume control, fast forward, fast backward, … So I look a closer look to the MCI and found something interesting about reading a wav file in it. So I’ll try to do something with it, like reverse the file, fasten it,… to get acquainted with the library. The PlaySound() is for later, hehe
A lot of troubles happen when start working with the Visual Studio. Its linker is kind of a mess :( Lot of configurations to make it work with the library :-(

Update:
I’ve just written few lines of code, well, it can run but there’s still one thing I still cannot get:

UCHAR * buffer = new UCHAR[child.cksize];
unsigned long n = sizeof(buffer);
mmioRead(handle, (char*)buffer, child.cksize);
n = sizeof(buffer);

The value of child.cksize is really big, greater than 20k, but when I allocate the buffer and check for the value of n, before and after the mmioRead funtion call, it is always 4 :(
The things I get confuse is that, after those code, I call a function to write down the buffer to another file, it works perfectly with the buffer I pass on :( The write function:

bool song::write(unsigned long size, UCHAR* buffer) {
// Get a new file name
char outwav[MAX_PATH];
ZeroMemory(&outwav[0],sizeof(outwav));
strcpy(&outwav[0],”hieu.wav”);
outwav[strlen(&outwav[0])-3] = ‘p’;
outwav[strlen(&outwav[0])-2] = ‘c’;
outwav[strlen(&outwav[0])-1] = ‘m’;
// Write the data
LPWSTR temp = strToLPWSTR(&outwav[0]);
HANDLE hpcm = CreateFile((LPCWSTR)temp,GENERIC_WRITE,NULL,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
DWORD written;
WriteFile(hpcm,&buffer[0],size,&written,NULL);
CloseHandle(hpcm);

return true;
}

Gotta figure out what the heck is this soon :(

Nara audio player project launch

Posted in Nara audio player, Projects by Hieu T. Luong on May 16, 2010

Well, this may sound like I’m going to create a big project, but it’s not.
The field that I want to work on as my career is about audio processing, and I think instead of sitting at a place dreaming, I’ve got to start doing something.
My goal is to finished 2 applications on audio field by the end of this year 2010, and this project is to develop the first one, an audio player. The second one is an audio converter, which is properly more complex.

About the name, I promised to name my first software after the nickname of a friend, although I don’t know if she still considers me her friend but it’s still a promise, so the application will be Nara audio player.

It should be able to play at least wav, mp3 and wma audio file. I’m going to use C++ for the logic processing because I believe that maybe C++ is not a good choice for developing an audio player but it is commonly used in audio coding, which is my main goal.

At the moment, the study at University, and the guitar study, and my part-time job as a web developer takes all the time, so I’m considering quiting the job to focus on my audio study, maybe after the next 2 months ’cause there are still a lots of things to do for the current web project that I’m involved in.

I think I should start by getting to know how to play an audio file, then get it to play a play-list. As I said above, I don’t have much time for this project until July, so you shouldn’t expect my posts about this project very often.

Now it’s time to work :(
Hope to see you soon!

Sunday morning rain is falling…

Posted in Daily notes by Hieu T. Luong on May 16, 2010

Suddenly remembered this song when I was going to Thủ Đức for practicing with my band.
It was a hot day and there was very little of cloud in the sky, but few drops of water fall on to my face. The melody of this song came immediately as if someone had been waiting with his hand on the play button.
Such a beautiful song…
http://www.youtube.com/watch?v=S2Cti12XBw4

Hello!

Posted in Uncategorized by Hieu T. Luong on May 15, 2010

Hi there,

This is not my first post in this blog, actually I have deleted all the previous posts to make a new start with this one.
I want to write down in this blog things in my daily life, and projects that I’m working on including projects at University and projects that I work at home.

Hope that you’ll find it interesting.

Best wishes,
Hiếu

Follow

Get every new post delivered to your Inbox.