Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Is it possible to play an mp3 with DirectSound? This is what I am using for wav files:

 

Dim xx As New Device
xx.SetCooperativeLevel(Me, CooperativeLevel.Priority)
Dim ss As New SecondaryBuffer("c:\file.wav", xx)
ss.Play(0, BufferPlayFlags.Default)

 

I tried just to put an mp3 as the filename, but it didnt like that at all. Bad mistake to make in a full screen app, let me tell you.

Posted

I tried just to put an mp3 as the filename, but it didnt like that at all. Bad mistake to make in a full screen app, let me tell you.

Lol. You had to restart your comp?

Tip: Name your project starting with a z next time. When it hangs like that, hit control alt delete (you won't see it), hit z, hit delete, and hit enter. It's sort of confusing to explain. Hitting z will go to the next item on the list (in the task manager) that starts with a z and delete is the same as End Task, and hitting Enter will answer Yes to the 'Do you want to end task?' question. Neat little trick.

 

If that doesn't work, then you'll have to alt+tab to what you think is the task manager and give it a try. It usually always works for me though.

 

Unfortunately, one of my applications was named something like DirectXTest1, and hitting d, delete, enter, it quit devenvr.exe (.NET), so I couldn't see the error.

 

Honestly, I don't know the asnwer to your question.

 

-The Pentium Guy

My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!)

vbprogramming.8k.com

My Project (Need VB.NET Programmers)

http://workspaces.gotdotnet.com/ResolutionRPG

Posted

Dim ss As New SecondaryBuffer("c:file.wav", xx)

ss.Play(0, BufferPlayFlags.Default)

 

try to do something like this:

 

Dim aud as new Microsoft.DirectX.AudioVideoPlayback.Audio

aud.FileName = "C:/file.wav")

aud.Play

George C.K. Low

Posted

Yeah, i am using AudioVideoPlayback at the moment, but I can only play one MP3 at a time like that. I wanted to play a soundtrack, and some long environment noise type sounds as well, and i was wondering if it was possible with DirectSound.

 

Hehe, yeah, i had to restart, but recently I found a way out of it. I have a Logitech MX700 combo keyboard and mouse, and if I press the moon shape (which sends windows 2000 to sleep, but not XP), it goes to the Welcome screen, then when i go back into XP, i can see the taskbar, and can right click on the app and close it, hehe.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...