File: gvUtil.h

package info (click to toggle)
openmohaa 0.82.1%2Bdfsg-1
  • links: PTS, VCS
  • area: contrib
  • in suites: forky, sid
  • size: 34,192 kB
  • sloc: cpp: 315,720; ansic: 275,789; sh: 312; xml: 246; asm: 141; makefile: 7
file content (35 lines) | stat: -rw-r--r-- 993 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
GameSpy Voice2 SDK
Dan "Mr. Pants" Schoenblum
dan@gamespy.com

Copyright 2004 GameSpy Industries, Inc

devsupport@gamespy.com
http://gamespy.net
*/

#ifndef _GV_UTIL_H_
#define _GV_UTIL_H_

#include "gvMain.h"
#include "gvCodec.h"

// gets the volume for a set of samples
GVScalar gviGetSamplesVolume(const GVSample * samplesPtr, int numSamples);

// checks if any samples in the set are above the given threshold
GVBool gviIsOverThreshold(const GVSample * samplesPtr, int numSamples, GVScalar threshold);

// returns the lowest multiple of base that is >= value
int gviRoundUpToNearestMultiple(int value, int base);
// returns the highest multiple of base that is <= value
int gviRoundDownToNearestMultiple(int value, int base);
// rounds the multiple of base that is closest to value
int gviRoundToNearestMultiple(int value, int base);

// multiply or divide by bytes per millisecond
int gviMultiplyByBytesPerMillisecond(int value);
int gviDivideByBytesPerMillisecond(int value);

#endif