QJ.NET | Videos | Forums | iPhone | MMORPG | Nintendo DS | Wii | PlayStation 3 | PSP | Xbox 360 | PC | Downloads | Contact Us
Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact

QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides

Go Back   QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides > Developers Corner > PSP Development, Hacks, and Homebrew > PSP Development Forum
The above video goes away if you are a member and logged in, so log in now!

playing wav files for sound effects using C?

This is a discussion on playing wav files for sound effects using C? within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; i can play background music via MP3_Init(1); MP3_Load("mySong.mp3"); MP3_Play(); but how do i make sound effects like for punching and ...

Reply
 
LinkBack Thread Tools
Old 02-23-2008, 10:02 PM   #1

PREMIUM Member
 
dragula96's Avatar
 
Join Date: Jun 2005
Posts: 312
Trader Feedback: 0
Default playing wav files for sound effects using C?

i can play background music via

MP3_Init(1);
MP3_Load("mySong.mp3");
MP3_Play();

but how do i make sound effects like for punching and stuff for my game?

i am starting to code in C but cant find any info on it.
i am trying to play a sound everytime i hit 'X' for example.

thanks in advance.
dragula96 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-23-2008, 11:41 PM   #2

Developer in Making...
 
BlackShark's Avatar
 
Join Date: Oct 2006
Location: Pimp'en in the US F#cking A!!!
Posts: 1,254
Trader Feedback: 0
Default

Give ol' OSLIB a try, its very, very useful, if your using Graphics.c/h then i would suggested switching to OSLIB, its much more awesome, and its made of pure win. I guarantee it.
__________________
The Wentire Worls in two Sectors....
When did I get dev statz?
Spoiler for my PSP homebrewReleases:
Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
(PvP Pong DL'ed well over 2403 times combined! get yours now!)
Spoiler for Great Quotes:

"No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.
BlackShark is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-24-2008, 12:15 AM   #3

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Default

BlachShark - You succeeded in doing everything but answering his question... Good job! </sarcasm>

dragula - libmikmod (or mikmodlib, can't remember which one is the most recent in the SVN >.<) is a module player and library supporting many formats.

From their main site:

(669 (Composer 669, Unis 669), AMF (DSMI Advanced Module Format), AMF (ASYLUM Music Format V1.0), APUN (APlayer), DSM (DSIK internal format), FAR (Farandole Composer), GDM (General DigiMusic), IT (Impulse Tracker), IMF (Imago Orpheus), MOD (15 and 31 instruments), MED (OctaMED), MTM (MultiTracker Module editor), OKT (Amiga Oktalyzer), S3M (Scream Tracker 3), STM (Scream Tracker), STX (Scream Tracker Music Interface Kit), ULT (UltraTracker), UNI (MikMod), XM (FastTracker 2))
__________________
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-24-2008, 12:27 AM   #4

Developer in Making...
 
BlackShark's Avatar
 
Join Date: Oct 2006
Location: Pimp'en in the US F#cking A!!!
Posts: 1,254
Trader Feedback: 0
Default

Quote:
Originally Posted by SG57
BlachShark - You succeeded in doing everything but answering his question... Good job! </sarcasm>

dragula - libmikmod (or mikmodlib, can't remember which one is the most recent in the SVN >.<) is a module player and library supporting many formats.

From their main site:

(669 (Composer 669, Unis 669), AMF (DSMI Advanced Module Format), AMF (ASYLUM Music Format V1.0), APUN (APlayer), DSM (DSIK internal format), FAR (Farandole Composer), GDM (General DigiMusic), IT (Impulse Tracker), IMF (Imago Orpheus), MOD (15 and 31 instruments), MED (OctaMED), MTM (MultiTracker Module editor), OKT (Amiga Oktalyzer), S3M (Scream Tracker 3), STM (Scream Tracker), STX (Scream Tracker Music Interface Kit), ULT (UltraTracker), UNI (MikMod), XM (FastTracker 2))
Oh, GG.
that makes sence for beginners,

@Dracula,
OSLIB will allow you to load and play wave files easily. 'Tis why i suggested it.
__________________
The Wentire Worls in two Sectors....
When did I get dev statz?
Spoiler for my PSP homebrewReleases:
Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
(PvP Pong DL'ed well over 2403 times combined! get yours now!)
Spoiler for Great Quotes:

"No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.
BlackShark is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-24-2008, 12:38 AM   #5

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Default

Quote:
Originally Posted by BlackShark
that makes sence for beginners,
Ok so... judging from what you said, recommending an advanced, fairly complex graphics library to a beginner over the straightforward graphics.c/h makes sense?

Rather then suggesting to completely redesign the graphics portion of his game just to implement sound playback, just do what he asks and give him a library for implementing sounds, nothing more and nothing less. No going back and changing, just adding.
__________________
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-24-2008, 01:34 AM   #6

Developer in Making...
 
BlackShark's Avatar
 
Join Date: Oct 2006
Location: Pimp'en in the US F#cking A!!!
Posts: 1,254
Trader Feedback: 0
Default

...Shouldn't you be going to bed?


(and complex? common' its much easier to use than Graphics.whatever)
__________________
The Wentire Worls in two Sectors....
When did I get dev statz?
Spoiler for my PSP homebrewReleases:
Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
(PvP Pong DL'ed well over 2403 times combined! get yours now!)
Spoiler for Great Quotes:

"No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.
BlackShark is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-24-2008, 08:24 AM   #7

PREMIUM Member
 
dragula96's Avatar
 
Join Date: Jun 2005
Posts: 312
Trader Feedback: 0
Default

well i tried mikmodlib for about 2 hours, couldent get it to work, at first it would freez my slim when i tried to play the sound, then i re-write the code and then the memory stick indicator LED would just keep blinking endlessly

dragula96 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-24-2008, 08:31 AM   #8

Developer
 
Join Date: Mar 2006
Posts: 1,026
Trader Feedback: 0
Default

http://insomniac.0x89.org/index.php?id=48
__________________

Check out my homebrew & C tutorials at http://insomniac.0x89.org/
Coder formerly known as Insomniac197

Quote:
tshirtz: what is irshell ??
Atarian_: it's where people who work for the IRS go when they die
Insert_Witty_Name is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-24-2008, 08:54 AM   #9

PREMIUM Member
 
dragula96's Avatar
 
Join Date: Jun 2005
Posts: 312
Trader Feedback: 0
Default

Quote:
Originally Posted by Insert_Witty_Name
i installed mikmod but there is not directory named "examples" in the archive

enyway looks like OSlib did the job, i just used the audio part of it.

thanks for the help guys now i can make tetris

oh by the way, has anyone used Jes game engine? is it good?

Last edited by dragula96; 02-24-2008 at 09:09 AM..
dragula96 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-24-2008, 02:47 PM   #10
Art

Bush Programmer
 
Art's Avatar
 
Join Date: Nov 2005
Posts: 3,557
Trader Feedback: 0
Default

I don't know why you'd worry about Mikmod for wav files when it can only use
samples of **** quality anyway.
Indeed it's a good mod player, but I wouldn't use it in a game for sound effects.
That DTMF dial app, and Road Dog both have source released,
and clearly show an easy way to play CD quality samples, but looks like you got it sorted.
Art is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-24-2008, 03:52 PM   #11

OMFG
 
Slasher's Avatar
 
Join Date: Jul 2005
Location: Toronto
Posts: 2,816
Trader Feedback: 0
Default

Where can I get either of your apps sources?
I'm interested in switching from mikmod
Slasher is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-24-2008, 04:47 PM   #12
Art

Bush Programmer
 
Art's Avatar
 
Join Date: Nov 2005
Posts: 3,557
Trader Feedback: 0
Default

DTMF Dial is probably the simplest:
http://dl.qj.net/DTMF-Dial-v3-source...5954/catid/203
since it doesn't have any of the other source to string samples together.
You could probably find the other on QL downloads as well, it's at least posted
in one of the release threads.
Art is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
effects , files , playing , sound , wav

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -8. The time now is 06:17 AM.



Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © 2009, QJ.NET. All Rights Reserved.
Contact Us