Code Monkey home page Code Monkey logo

caudio's People

Contributors

bkeys avatar darkkilauea avatar gachapen avatar geromueller avatar hhyyrylainen avatar lavesson avatar loneboco avatar manylegged avatar r4stl1n avatar ramccor avatar tc01 avatar wolfmanfx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

caudio's Issues

enabling getLogger()

this is probably a dumb question, but I ned some help. I'm trying to get the Cortex Command ubuntu build to run on my computer. One of the (thankfully shared) libs it relies on is cAudio. I cloned myself the source and built the lib with no difficulties, but when I run the game, it says 'undefined symbol: getLogger', which is part of cAudio (defined at cAudio.cpp).

After building and installing the lib from source, if I run "strings /usr/local/lib/libcAudio.so | grep getLogger" I get nothing, but if I do the same on the compiled library the game shipped with, it is present.

Is there some configuration flag that disables the logging functionality? Thank you

MP3 plugin crash (Linux)

Hi, im using the latest version of cAudio.
I modified the tutorial 1 for a test case, so it plays a mp3 file.
But my application crashes when loading the mp3 plugin, if I disable the plugin and play a .wav file eveything works fine.

cAudio 2.3.0 Tutorial 1: Basic 2D Audio.

[Information] Audio Decoder for extension .ogg registered.
[Information] Audio Decoder for extension .wav registered.
[Information] Audio Decoder for extension .raw registered.
[Information] Data Source named FileSystem registered (Priority 0).
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_S_construct null not valid
Aborted (core dumped)

Threading not working as expected on Linux

Problem

When building on Linux the variable for threading gets set to 1 all through the CMake config, CMake headers and generated headers. No warnings or errors during compile but the audioManager does not get updated automatically as expected on a threaded version of the library.

Symptoms

All the examples, where the threaded library should make music play through to the end, requires an additional line of audioMgr->update() in the while(mysound->isPlaying()) block to work as expected.

Investigation

I followed the code to the point that I'm sure it's configured correctly and that pthreads gets included in the build. However I think the assistance of a main developer on this issue might get us to a resolution faster.

Solution

I'm prepared to spend time and effort on fixing this issue, seams logical since I'm building on Linux anyways, but would request the help of a developer to get into the code faster (no point in floundering around for a week ;o). Contact me if you can help. I'll get stuck in in the meanwhile...

Compiling issues on Windows (Visual Studio)

see title

#19

Output

Severity	Code	Description	Project	File	Line	Suppression State
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	C:\Users\memor\Desktop\cAudio-master\cAudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	C:\Users\memor\Desktop\cAudio-master\cAudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	C:\Users\memor\Desktop\cAudio-master\cAudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	C:\Users\memor\Desktop\cAudio-master\cAudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	C:\Users\memor\Desktop\cAudio-master\cAudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	C:\Users\memor\Desktop\cAudio-master\cAudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	C:\Users\memor\Desktop\cAudio-master\cAudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	C:\Users\memor\Desktop\cAudio-master\cAudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	C:\Users\memor\Desktop\cAudio-master\cAudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	C:\Users\memor\Desktop\cAudio-master\cAudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	C:\Users\memor\Desktop\cAudio-master\cAudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	C:\Users\memor\Desktop\cAudio-master\cAudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	64	
````

cAudioManager->releaseAllSources bug

Problem:

    void cAudioManager::releaseAllSources()
    {
        cAudioMutexBasicLock lock(Mutex);
        size_t count = audioSources.size();
        for(size_t i=0; i<count; i++)
        {
            IAudioSource* source = audioSources[i];
            if(source)
                source->drop();
        }

As sources are dropped, they are erased from audioSources while count and i remain the same. This causes an index out of bounds exception sooner or later.

Solution:

void cAudioManager::releaseAllSources()
    {
        cAudioMutexBasicLock lock(Mutex);
        cAudioVector<IAudioSource*>::Type tempList(audioSources.begin(), audioSources.end());
        size_t count = audioSources.size();
        for(size_t i=0; i<count; i++)
        {
            IAudioSource* source = tempList[i];
            if(source)
                source->drop();
        }

Some bugs and errors on Mac and Windows

Hello,

I found several problems compiling the cAudio statically
The main problems concern the use of STL and thread

Here are some examples of output (in Mac using the debugger)...

  1. This example creates the file cymal2.wav, it plays back, the program terminates when the error appears:

[Information] Audio Source (drumdata/cymbal2.wav) created from Data Source FileSystem.
[Information] Manager successfully shutdown.

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x6f697473
0x0a6b1b9c in std::less<void*>::operator() (this=0xa6dea90, __x=@0x6f697473, __y=@0xbfffe8d8) at stl_function.h:227
227 { return __x < __y; }

  1. The same example above, but with a different crash:

[Information] Audio Source (drumdata/cymbal2.wav) created from Data Source FileSystem.
[Information] Manager successfully shutdown.

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0xd03ce800
[Switching to process 9315 thread 0x951b]
0x0a6b3e74 in cAudio::cAudioThread::updateLoop (this=0x5e3f2d0) at /Users/.../cAudio/cAudio/src/cThread.cpp:71
71 Worker->run();

  1. A crash by running the Tutorial1_2DSound, an example of cAudio:

gdb) run
Starting program: /Users/.../cAudio/build/Examples/Tutorial1_2DSound/Debug/Tutorial1_2DSound
Reading symbols for shared libraries .+++................................ done
cAudio 2.3.0 Tutorial 1: Basic 2D Audio.

[Information] Audio Decoder for extension .ogg registered.
[Information] Audio Decoder for extension .wav registered.
[Information] Audio Decoder for extension .raw registered.
[Information] Data Source named FileSystem registered (Priority 0).

Available Playback Devices:
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
0): Built-in Output [DEFAULT]

Choose a device by number: 0

[Information] OpenAL Version: 1.1
[Information] Vendor: Apple Computer Inc.
[Information] Renderer: Software
[Information] Supported Extensions: AL_EXT_OFFSET AL_EXT_LINEAR_DISTANCE AL_EXT_EXPONENT_DISTANCE AL_EXT_float32 AL_EXT_STATIC_BUFFER
[Information] Audio Source (bling) created from Data Source FileSystem.
[Information] Audio Source () created from Data Source FileSystem.
[Information] Audio Source () created from Data Source FileSystem.
[Information] Audio Source () created from Data Source FileSystem.
[Information] Audio Source () created from Data Source FileSystem.
[Information] Audio Source () created from Data Source FileSystem.
[Information] Audio Source () created from Data Source FileSystem.
[Information] Audio Source () created from Data Source FileSystem.
[Information] Audio Source () created from Data Source FileSystem.
[Information] Audio Source () created from Data Source FileSystem.
[Information] Audio Source () created from Data Source FileSystem.
[Information] Manager successfully shutdown.
Press any key to quit

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x0000000d
0x00119f4e in std::_Rb_tree_increment ()

The crash also appear in the windows version, though for some reason you can not debug.

call setDopplerStrength, setDopplerVelocity , it will log OpenAL Error: Invalid Enum.

thanks your lib..
I use stable 2.2 cAudio Verson then setDopplerVelocity will log invlalid enum

i google it .. and find
http://opensource.creative.com/pipermail/openal-devel/2005-October/003659.html

call setDopplerStrength, setDopplerVelocity functions
it will log OpenAL Error: Invalid Enum.

i find the answer.. QQ
alSourcef just support enums below lists in openal guide
AL_PITCH
AL_GAIN
AL_MIN_GAIN
AL_MAX_GAIN
AL_MAX_DISTANCE
AL_ROLLOFF_FACTOR
AL_CONE_OUTER_GAIN
AL_CONE_INNER_ANGLE
AL_CONE_OUTER_ANGLE
AL_REFERENCE_DISTANCE

In Effect Filter has the same problem..
alSourcei(Source, AL_DIRECT_FILTER, theFilter->getOpenALFilter());

MP3 seeking

MP3 seeking to specified time doesn't work correctly. It compares specified position (computed from bitrate) with position in compressed stream - IMHO it's not correct. After my own some changes it still not works :(

OpenAL Error 40963 Invalid Value when creating 256 sounds

Not sure if this was submitted or if this is even a cAudio bug but I'm having trouble creating a large number of audio sources.
I essentially have a loop that calls cAudioManager::create repeatedly and it always crashes on sound #256

I'm passing the same filename and a different name at each iteration. I'm passing in false for stream. Code:

IAudioSource* sources[512];
const char fn = "myFile.ogg";
for (int i = 0; i < 512; i++)
{
    std::stringstream n;
    n << "Sound " << i;
    sources[i] = mgr->create(n.str().c_str(), fn, false);
}

I traced the execution and it seems to to be an openal error. Error code 40963. The error string is "Invalid Value". Seems like alGenSources in cAudioSource.cpp (line 51) is what is setting the error state as the state variable was true prior to the checkError() call that comes after the alGenSources call. Any ideas what's up?

I'm running on a develop build of cAudio from commit 86548b9

Unable to disable logging

As a way to avoid the logging issues I have recieved I tried to use both CMake variables
CAUDIO_ENABLE_DEFAULT_FILE_LOGGER
CAUDIO_ENABLE_DEFAULT_CONSOLE_LOGGER
as a way to try to remove logging all together. However both binary files and cAudioEngineLog.html are output as they were before.

File with binary names are created

I believe this was caused by my pull request, anyways in a cAudio application there will occasionally be files created that have strange names (in binary?) that contain the normal contents of cAudioEngine.html however in different files. There must of been file I/O happening involving logging in a place that I did not find. This should be fixed at some point as it makes it difficult to create something professional with cAudio if it places files in the current directory, this was why I tried changing the logging system in the first place.
For bonus points the logging could of been redone with easyloggingpp if you ever get the time to move it over, this is a helpful logger because it outputs to the screen and to a file and is very configurable (plus it is MIT licensed). It would be great to include it as the logging system for the next version of cAudio.
https://github.com/easylogging/easyloggingpp/
It even supports colored output now :) If in the event you do not get time towards the end of the release of my game I will fix it myself, however it would be nice if upstream did this on it's own.

can only build on APPLE or WIN32

CMake/InstallDependencies.cmake returns immediately if not APPLE or WIN32
so the function 'install_all_targets' is never defined,
making it fail on 'install_all_targets(cAudio)' in cAudio/CMakeLists.txt

Logging system is very rigid

Hey FYI there is no way to configure the logging system for cAudio to put its log files in any place other than the current directory. I am working on a fork that will have the logging refractored in a way that the audio manager can configure which file the log files will be in, but it will be a default parameter so it should not break any interfaces at all.

min/maxDistance bug

When applying a min and maxDistance to an sound, the sound volume is not increasing or decreasing

missing include

in cAudio/src/cOpenALAudioDeviceList.cpp alext.h should be included as well. Otherwise ALC_ALL_DEVICES_SPECIFIER is not defined.

create new stable branch

Shutdown cAudioManager will be crash in 2.2 version
if you have created audio source inside..
the audio source iterator will be erased in dropping
so releasing all resource will be crash..

I see the fixed at newest version but it's 2.3
could you create one stable branch to update the fix?
bcz I use the newest version in window .
it will compile error...below
caudio\include\cAudioString.h(88) : error C2664: 'WideCharToMultiByte' : cannot convert parameter 3 from 'const char *' to 'LPCWSTR'

C# build fails due to missing setMaxDistance

I attempted to compile the C# wrapper on Linux (Fedora 24) and it failed with the following issue:

/home/bjr/rpmbuild/SOURCES/cAudio-patched/cAudioCSharpWrapper/src/cAudioWrapped_wrap.cxx: In function ‘void CSharp_IAudioSource_setMaxDistance(void*, float)’:
/home/bjr/rpmbuild/SOURCES/cAudio-patched/cAudioCSharpWrapper/src/cAudioWrapped_wrap.cxx:4896:11: error: ‘class cAudio::IAudioSource’ has no member named ‘setMaxDistance’; did you mean ‘getMaxDistance’?
   (arg1)->setMaxDistance((float const &)*arg2);
           ^~~~~~~~~~~~~~
cAudioCSharpWrapper/CMakeFiles/cAudioCSharpWrapper.dir/build.make:62: recipe for target 'cAudioCSharpWrapper/CMakeFiles/cAudioCSharpWrapper.dir/src/cAudioWrapped_wrap.cxx.o' failed
make[2]: *** [cAudioCSharpWrapper/CMakeFiles/cAudioCSharpWrapper.dir/src/cAudioWrapped_wrap.cxx.o] Error 1
CMakeFiles/Makefile2:253: recipe for target 'cAudioCSharpWrapper/CMakeFiles/cAudioCSharpWrapper.dir/all' failed
make[1]: *** [cAudioCSharpWrapper/CMakeFiles/cAudioCSharpWrapper.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Is this expected to work currently?

IManagerEventHandler not firing events

Hi all,
I've wrapped cAudio with a singleton manager that uses the audiomanager with the threaded update feature.

The interface that I inherit from IManagerEventHandler.h includes the virtual functions that can be overridden like "onUpdate()" but cAudioManager.cpp never actually fires the events although it does handle them all.

The fix is very simple, just one line, and I'll be happy to create a pull request from what I've modified to make it work in my case. However, I'm curious to hear if there's something obvious that I've missed with how this is supposed to work or whether it's always been left unimplemented for some reason.

In case you're interested, my wrapper has a music playlist which needs to be advanced at the end of a song and does things like fade outs when notified by the game engine thread. That's why I need to get the update event firing.

Cheers and thanks for cAudio!

cAudioString.h broken for unicode

Unicode support in cAudioString.h was broken on this commit:
21ab759

Here is a patch to fix it (jeez, is it impossible to attach files??)

--- cAudio/include/cAudioString2.h  Tue Jun 26 15:36:26 2012
+++ cAudio/include/cAudioString.h   Wed Jul 04 10:18:34 2012
@@ -58,19 +58,11 @@
         return buffer[id];
     }

     static const TCHAR* toWINSTR(const wchar_t* str)
     {
-        static int id = 0;
-        static char buffer[8][1024];
-        id = ++id & 0x7;
-    
-        int slen = wcslen(str);
-        int buff_size = WideCharToMultiByte(CP_UTF8, 0, str, (int)(slen < 1023 ? slen : 1023), buffer[id], 1023, 0, false);
-        buffer[id][buff_size] = 0;
-        buffer[id][1023] = 0;
-        return buffer[id];
+       return str;
     }

     static const char* toUTF8(const cAudioString& str)
     {
         static int id = 0;
@@ -87,12 +79,11 @@
     {
         wchar_t* buffer = 0;
         int buff_size = MultiByteToWideChar(CP_UTF8, 0, str, (int)strlen(str), 0, 0);
         if (buff_size == 0)
             return cAudioString();
-        
-        
+
         buffer = new wchar_t[buff_size + 1];
         memset((void*)buffer, 0, sizeof(wchar_t) * (buff_size + 1));
         MultiByteToWideChar(CP_UTF8, 0, str, (int)strlen(str), buffer, buff_size);
         cAudioString s(buffer);
         delete[] buffer;
@@ -100,18 +91,26 @@
     }

 #else
     static const char* toWINSTR(const char* str) 
     {
-        return str;
-    }
+        static int id = 0;
+        static char buffer[8][1024];
+        id = ++id & 0x7;

+        int slen = wcslen(str);
+        int buff_size = WideCharToMultiByte(CP_UTF8, 0, str, (int)(slen < 1023 ? slen : 1023), buffer[id], 1023, 0, false);
+        buffer[id][buff_size] = 0;
+        buffer[id][1023] = 0;
+        return buffer[id];
+    }
+
     static const char* toUTF8(const cAudioString& str)
     {
         return str.c_str();
     }
-        
+
     static cAudioString fromUTF8(const char* str)
     {
         return cAudioString(str);
     }
 #endif

Version libcAudio.so?

I'm looking into possibly packaging cAudio for Fedora.

It appears that you don't version libcAudio.so; would it be possible for you to start doing so upstream? Most downstream distributions want any shared libraries installed by packages to be versioned in order to better guarantee ABI compatibility; you can read Fedora's guidelines on the subject here.

cmake should make it very easy to version a library.

Original cAudio

https://github.com/netpipe/AgAudio if you want to provide a link to original cAudio in the readme. it works well for placing directly into games without linking just got native wav support working. hopefully a new midi player next month too.

emscripten

cmake needs updating to find openal properly. also we need a logo for cAudio

Build error on linux

[ 80%] Building CXX object cAudio/CMakeFiles/cAudio.dir/src/cOpenALAudioDeviceList.cpp.o
/home/steven/Public/Quantum/cfhs/Applications/extra/wildicv-cAudio-9e85ee9/cAudio/src/cOpenALAudioDeviceList.cpp:5:9: warning: #pragma once in main file [enabled by default]
/home/steven/Public/Quantum/cfhs/Applications/extra/wildicv-cAudio-9e85ee9/cAudio/src/cOpenALAudioDeviceList.cpp: In constructor ‘cAudio::cOpenALAudioDeviceList::cOpenALAudioDeviceList(cAudio::IDeviceType)’:
/home/steven/Public/Quantum/cfhs/Applications/extra/wildicv-cAudio-9e85ee9/cAudio/src/cOpenALAudioDeviceList.cpp:28:17: error: ‘ALC_ALL_DEVICES_SPECIFIER’ was not declared in this scope
/home/steven/Public/Quantum/cfhs/Applications/extra/wildicv-cAudio-9e85ee9/cAudio/src/cOpenALAudioDeviceList.cpp:29:21: error: ‘ALC_DEFAULT_ALL_DEVICES_SPECIFIER’ was not declared in this scope
make[2]: *** [cAudio/CMakeFiles/cAudio.dir/src/cOpenALAudioDeviceList.cpp.o] Error 1
make[1]: *** [cAudio/CMakeFiles/cAudio.dir/all] Error 2
make: *** [all] Error 2

Wav decoder not handle well formated wav files and crash cAudio

Wav decoder doesn't find "fmt " tag in a wav file because it searches for it every 4 bytes. But the junk chunk only have to be even, not necessarily a multiple of 4.
And it seems to be the same problem for the "data" tag.

A side effect is the crash of cAudio at line 288 in cAudioManager.cpp.

The source is first dropped at line 281, then it's dropped in IAudioDecoder's destructor (called at the end of cAudioManager::createAudioSource) and destroyed.
The "source" variable is not null at line 287 but point on an invalid memory segment, so the third called to drop() at line 288 crashed cAudio.

Example of not handled wav :
http://www.soundbyter.com/2012/04/free-train-door-closing-sound-effect/

Compiling on MSYS2/MinGW

This is more of a request.

Tried compiling via msys2 but got:

cmake ../ -DCAUDIO_DEPENDENCIES_DIR=../Dependencies64/
System is unknown to cmake, create:
Platform/MINGW64_NT-6.1 to use this system

Can you please support compiling with msys2?

~creek23

CAudio 2.3.0 won't compile in Visual Studio 2013

Hello!

I keep getting "unresolved externals" errors while trying to compile CAudio in VS Express 2013.

Here's my log:

Error 28 error LNK2019: unresolved external symbol __imp_alSourceUnqueueBuffers referenced in function "private: void __cdecl cAudio::cAudioSource::empty(void)" (?empty@cAudioSource@cAudio@@AEAAXXZ) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cAudioSource.obj cAudio
Error 25 error LNK2019: unresolved external symbol __imp_alSourceStop referenced in function "public: virtual __cdecl cAudio::cAudioSource::~cAudioSource(void)" (??1cAudioSource@cAudio@@UEAA@XZ) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cAudioSource.obj cAudio
Error 27 error LNK2019: unresolved external symbol __imp_alSourceQueueBuffers referenced in function "public: virtual bool __cdecl cAudio::cAudioSource::play(void)" (?play@cAudioSource@cAudio@@UEAA_NXZ) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cAudioSource.obj cAudio
Error 24 error LNK2019: unresolved external symbol __imp_alSourcePlay referenced in function "public: virtual bool __cdecl cAudio::cAudioSource::play(void)" (?play@cAudioSource@cAudio@@UEAA_NXZ) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cAudioSource.obj cAudio
Error 26 error LNK2019: unresolved external symbol __imp_alSourcePause referenced in function "public: virtual void __cdecl cAudio::cAudioSource::pause(void)" (?pause@cAudioSource@cAudio@@UEAAXXZ) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cAudioSource.obj cAudio
Error 20 error LNK2019: unresolved external symbol __imp_alSourcei referenced in function "public: virtual bool __cdecl cAudio::cAudioSource::play2d(bool const &)" (?play2d@cAudioSource@cAudio@@UEAA_NAEB_N@Z) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cAudioSource.obj cAudio
Error 18 error LNK2019: unresolved external symbol __imp_alSourcef referenced in function "public: __cdecl cAudio::cAudioSource::cAudioSource(class cAudio::IAudioDecoder *,class cAudio::IAudioDeviceContext *)" (??0cAudioSource@cAudio@@qeaa@PEAVIAudioDecoder@1@PEAVIAudioDeviceContext@1@@z) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cAudioSource.obj cAudio
Error 19 error LNK2019: unresolved external symbol __imp_alSource3f referenced in function "public: virtual void __cdecl cAudio::cAudioSource::move(class cAudio::cVector3 const &)" (?move@cAudioSource@cAudio@@UEAAXAEBVcVector3@2@@z) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cAudioSource.obj cAudio
Error 34 error LNK2019: unresolved external symbol __imp_alListenerfv referenced in function "public: virtual void __cdecl cAudio::cListener::setDirection(class cAudio::cVector3 const &)" (?setDirection@cListener@cAudio@@UEAAXAEBVcVector3@2@@z) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cListener.obj cAudio
Error 32 error LNK2019: unresolved external symbol __imp_alListenerf referenced in function "public: virtual void __cdecl cAudio::cListener::setMasterVolume(float const &)" (?setMasterVolume@cListener@cAudio@@UEAAXAEBM@Z) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cListener.obj cAudio
Error 33 error LNK2019: unresolved external symbol __imp_alListener3f referenced in function "public: virtual void __cdecl cAudio::cListener::move(class cAudio::cVector3 const &)" (?move@cListener@cAudio@@UEAAXAEBVcVector3@2@@z) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cListener.obj cAudio
Error 1 error LNK2019: unresolved external symbol __imp_alGetString referenced in function "protected: bool __cdecl cAudio::cAudioCapture::checkError(void)" (?checkError@cAudioCapture@cAudio@@IEAA_NXZ) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cAudioCapture.obj cAudio
Error 23 error LNK2019: unresolved external symbol __imp_alGetSourcei referenced in function "private: void __cdecl cAudio::cAudioSource::empty(void)" (?empty@cAudioSource@cAudio@@AEAAXXZ) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cAudioSource.obj cAudio
Error 22 error LNK2019: unresolved external symbol __imp_alGetSourcefv referenced in function "public: virtual class cAudio::cVector3 const __cdecl cAudio::cAudioSource::getDirection(void)const " (?getDirection@cAudioSource@cAudio@@ueba?BVcVector3@2@XZ) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cAudioSource.obj cAudio
Error 21 error LNK2019: unresolved external symbol __imp_alGetSourcef referenced in function "public: virtual float const __cdecl cAudio::cAudioSource::getDopplerStrength(void)const " (?getDopplerStrength@cAudioSource@cAudio@@ueba?BMXZ) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cAudioSource.obj cAudio
Error 14 error LNK2019: unresolved external symbol __imp_alGetError referenced in function "public: __cdecl cAudio::cAudioSource::cAudioSource(class cAudio::IAudioDecoder *,class cAudio::IAudioDeviceContext *)" (??0cAudioSource@cAudio@@qeaa@PEAVIAudioDecoder@1@PEAVIAudioDeviceContext@1@@z) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cAudioSource.obj cAudio
Error 16 error LNK2019: unresolved external symbol __imp_alGenSources referenced in function "public: __cdecl cAudio::cAudioSource::cAudioSource(class cAudio::IAudioDecoder *,class cAudio::IAudioDeviceContext *)" (??0cAudioSource@cAudio@@qeaa@PEAVIAudioDecoder@1@PEAVIAudioDeviceContext@1@@z) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cAudioSource.obj cAudio
Error 29 error LNK2019: unresolved external symbol __imp_alGenBuffers referenced in function "public: __cdecl cAudio::cAudioSource::cAudioSource(class cAudio::IAudioDecoder *,class cAudio::IAudioDeviceContext *)" (??0cAudioSource@cAudio@@qeaa@PEAVIAudioDecoder@1@PEAVIAudioDeviceContext@1@@z) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cAudioSource.obj cAudio
Error 17 error LNK2019: unresolved external symbol __imp_alDeleteSources referenced in function "public: virtual __cdecl cAudio::cAudioSource::~cAudioSource(void)" (??1cAudioSource@cAudio@@UEAA@XZ) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cAudioSource.obj cAudio
Error 30 error LNK2019: unresolved external symbol __imp_alDeleteBuffers referenced in function "public: virtual __cdecl cAudio::cAudioSource::~cAudioSource(void)" (??1cAudioSource@cAudio@@UEAA@XZ) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cAudioSource.obj cAudio
Error 39 error LNK2019: unresolved external symbol __imp_alcOpenDevice referenced in function "public: virtual bool __cdecl cAudio::cOpenALDeviceContext::initialize(char const *,int,int)" (?initialize@cOpenALDeviceContext@cAudio@@UEAA_NPEBDHH@Z) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cOpenALDeviceContext.obj cAudio
Error 37 error LNK2019: unresolved external symbol __imp_alcMakeContextCurrent referenced in function "public: virtual bool __cdecl cAudio::cOpenALDeviceContext::initialize(char const *,int,int)" (?initialize@cOpenALDeviceContext@cAudio@@UEAA_NPEBDHH@Z) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cOpenALDeviceContext.obj cAudio
Error 35 error LNK2019: unresolved external symbol __imp_alcIsExtensionPresent referenced in function "public: __cdecl cAudio::cOpenALAudioDeviceList::cOpenALAudioDeviceList(enum cAudio::IDeviceType)" (??0cOpenALAudioDeviceList@cAudio@@qeaa@W4IDeviceType@1@@z) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cOpenALAudioDeviceList.obj cAudio
Error 6 error LNK2019: unresolved external symbol __imp_alcGetString referenced in function "protected: bool __cdecl cAudio::cAudioCapture::initOpenALDevice(void)" (?initOpenALDevice@cAudioCapture@cAudio@@IEAA_NXZ) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cAudioCapture.obj cAudio
Error 8 error LNK2019: unresolved external symbol __imp_alcGetIntegerv referenced in function "public: virtual void __cdecl cAudio::cAudioCapture::updateCaptureBuffer(bool)" (?updateCaptureBuffer@cAudioCapture@cAudio@@UEAAX_N@Z) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cAudioCapture.obj cAudio
Error 4 error LNK2019: unresolved external symbol __imp_alcGetError referenced in function "protected: bool __cdecl cAudio::cAudioCapture::checkError(void)" (?checkError@cAudioCapture@cAudio@@IEAA_NXZ) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cAudioCapture.obj cAudio
Error 38 error LNK2019: unresolved external symbol __imp_alcDestroyContext referenced in function "public: virtual bool __cdecl cAudio::cOpenALDeviceContext::initialize(char const *,int,int)" (?initialize@cOpenALDeviceContext@cAudio@@UEAA_NPEBDHH@Z) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cOpenALDeviceContext.obj cAudio
Error 36 error LNK2019: unresolved external symbol __imp_alcCreateContext referenced in function "public: virtual bool __cdecl cAudio::cOpenALDeviceContext::initialize(char const *,int,int)" (?initialize@cOpenALDeviceContext@cAudio@@UEAA_NPEBDHH@Z) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cOpenALDeviceContext.obj cAudio
Error 40 error LNK2019: unresolved external symbol __imp_alcCloseDevice referenced in function "public: virtual bool __cdecl cAudio::cOpenALDeviceContext::initialize(char const *,int,int)" (?initialize@cOpenALDeviceContext@cAudio@@UEAA_NPEBDHH@Z) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cOpenALDeviceContext.obj cAudio
Error 12 error LNK2019: unresolved external symbol __imp_alcCaptureStop referenced in function "public: virtual void __cdecl cAudio::cAudioCapture::stopCapture(void)" (?stopCapture@cAudioCapture@cAudio@@UEAAXXZ) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cAudioCapture.obj cAudio
Error 11 error LNK2019: unresolved external symbol __imp_alcCaptureStart referenced in function "public: virtual bool __cdecl cAudio::cAudioCapture::beginCapture(void)" (?beginCapture@cAudioCapture@cAudio@@UEAA_NXZ) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cAudioCapture.obj cAudio
Error 13 error LNK2019: unresolved external symbol __imp_alcCaptureSamples referenced in function "public: virtual void __cdecl cAudio::cAudioCapture::updateCaptureBuffer(bool)" (?updateCaptureBuffer@cAudioCapture@cAudio@@UEAAX_N@Z) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cAudioCapture.obj cAudio
Error 9 error LNK2019: unresolved external symbol __imp_alcCaptureOpenDevice referenced in function "protected: bool __cdecl cAudio::cAudioCapture::initOpenALDevice(void)" (?initOpenALDevice@cAudioCapture@cAudio@@IEAA_NXZ) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cAudioCapture.obj cAudio
Error 10 error LNK2019: unresolved external symbol __imp_alcCaptureCloseDevice referenced in function "protected: void __cdecl cAudio::cAudioCapture::shutdownOpenALDevice(void)" (?shutdownOpenALDevice@cAudioCapture@cAudio@@IEAAXXZ) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cAudioCapture.obj cAudio
Error 31 error LNK2019: unresolved external symbol __imp_alBufferData referenced in function "private: bool __cdecl cAudio::cAudioSource::stream(unsigned int)" (?stream@cAudioSource@cAudio@@AEAA_NI@Z) C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cAudioSource.obj cAudio
Error 2 error LNK2001: unresolved external symbol __imp_alGetString C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cAudioSource.obj cAudio
Error 3 error LNK2001: unresolved external symbol __imp_alGetString C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cOpenALDeviceContext.obj cAudio
Error 15 error LNK2001: unresolved external symbol __imp_alGetError C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cOpenALDeviceContext.obj cAudio
Error 7 error LNK2001: unresolved external symbol __imp_alcGetString C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cOpenALAudioDeviceList.obj cAudio
Error 5 error LNK2001: unresolved external symbol __imp_alcGetError C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\cOpenALDeviceContext.obj cAudio
Error 41 error LNK1120: 35 unresolved externals C:\Users\MichaelB\Desktop\Code\Libraries\cAudio-master\Build\cAudio\Release\cAudio.dll cAudio

Is there something I'm missing? Any help would be appreciated.

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.