Click here to Skip to main content
15,894,017 members
Articles / Multimedia / DirectX
Article

VideoGame: To develop the just Engine sound

Rate me:
Please Sign up or sign in to vote.
1.11/5 (16 votes)
23 Apr 20062 min read 37.1K   189   13   5
Oki.lib is a lib to use of the programmers to use in their projects develops with visual study NET 2003 or advanced and vc6.

Introduction

Oki.lib is a library for programers who develope with visual study NET 2003 or newer and VC6.
It allows to manage sound files in graphic engines or videogames and can be used for commercial projects or study purpose.

Oki.lib contains DirectShow-based functions for handling .mp3, .wav, and .mid, and directSound/3D function for .wav.

The sound files have to be placed in the directory "Okisound" which is created in the main project directory automaticly after starting .exe.

The number of sound files this oki.lib version can handle is max 64 for DirectShow, 64 for DirectSound and 64 for DirectSound3D.

The initialization process is logged in the LogOki.htm on runtime.

Download sourcecode 2.70 Mb

Download demo 2.79 Mb

Distributed files:

Description files:
0. Oki_2003.vcproj
Example project
1. Oki.h
Header file to put in the plan vs
2. Oki.lib and Oki.dll
Files library and dll to include in the project vs
3. Oki.htm
Tutorial Oki.lib

Configuration:

- Put Oki.lib and Oki.dll in main saying of the plan vs
- To include Oki.lib in the options of the compiler

In order to include Oki.lib to go in the panel of configuration of the compiler to click the button key of the mouse on Project/propierties/linker/input
in Additional Dependencies to eliminate all the voices if there are and to copy these:

oki.lib
strmiids.lib
dsound.lib
dxerr9.lib
dxguid.lib
d3dx9.lib
d3d9.lib
Dinput8.lib
winmm.lib
comctl32.lib

To make this step for the compilation in debug and release

For the compilation in release go in the panel of configuration of the compiler click on:
C/C++\Code Generation
In Runtime Library to choose the voice:
Single-threaded (/ML)

For the compilation in debug go in the panel of configuration of the compiler click on:
C/C++\Code Generation
In Runtime Library to choose the voice:
Single-threaded Debug (/MLd)

to press the push-button Applies and OK

- To include in the project vs the header oki.h and in the main.cpp main to put this line
#include "oki.h"

Example code:

//Init Game
//-----------------code-------------------
// Initialise sound
Inizializzazione(DXUTGetHWND(), GetModuleHandle(NULL));
// play sound DirectShow
SoundPlay_Show(1, 0);
// play sound DirectSound
SoundPlay_Sound(1, true, 0, 22050, 0);
// play sound DirectSound3D
SoundPlay_Sound3D(1);
//----------------end code--------------------

As you see is a lot much simple. In the tutorial there are more complex examples in order to realize just the engine of the sound

Points of Interest:

Managed with DirectShow files sound .mp3, .wav and .mid.
DirectSound and DirectSound3D .wav

Update new version and faq/comments:
http://www.twork.it/public/oki/guestbook.asp

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Italy Italy
programmer

Comments and Discussions

 
QuestionOnline translator? Pin
Mike_V23-Apr-06 14:50
Mike_V23-Apr-06 14:50 
The article is incomprehensible. Get a human being to translate for you and then you will make a better impression.
AnswerRe: Online translator? Pin
Joakim L23-Apr-06 19:29
Joakim L23-Apr-06 19:29 
GeneralRe: Online translator? Pin
okayit6024-Apr-06 0:43
okayit6024-Apr-06 0:43 
AnswerRe: Online translator? Pin
okayit6023-Apr-06 23:19
okayit6023-Apr-06 23:19 
GeneralRe: Online translator? Pin
Mike_V24-Apr-06 3:43
Mike_V24-Apr-06 3:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.