Giter VIP home page Giter VIP logo

pcaudiolib's Introduction

Portable C Audio Library 1.2


The Portable C Audio Library (pcaudiolib) provides a C API to different audio devices. It supports:

Audio Framework Operating System
ALSA Linux
CoreAudio Mac OS
OSS POSIX
PulseAudio Linux
QSA QNX
XAudio2 Windows

See the ChangeLog for a description of the changes in the various releases.

Build Dependencies

In order to build the project, you need:

  1. an autotools system (make, autoconf, automake, libtool and pkg-config);
  2. a C compiler (e.g. gcc or clang).

Optionally, you need:

  1. the alsa development libraries to enable alsa audio output;
  2. the pulseaudio development library to enable pulseaudio output.

Debian

Core dependencies:

Dependency Install
autotools sudo apt-get install make autoconf automake libtool pkg-config
c compiler sudo apt-get install gcc

Optional Libraries:

Dependency Install
alsa sudo apt-get install libasound2-dev
pulseaudio sudo apt-get install libpulse-dev

Mac OS

To enable CoreAudio output support you need to have the coreaudio framework on your system. Installing XCode along with the Mac OS SDK is the recommended way of getting it. For Xcode on OS X 10.9 and earlier C11 compiler or newer is needed.

Windows

Some of the Windows SDK APIs (e.g. the XAudio2 headers) don't compile with a C compiler, so a C++ compiler is needed to compile them.

Building

This project uses a standard autotools build system with an autogen.sh script. You can thus build the project using:

./autogen.sh
./configure --prefix=/usr
make

and install it using:

sudo make install

Bugs

Report bugs to the pcaudiolib issues page on GitHub.

License Information

The Portable C Audio Library is released under the GPL version 3 or later license.

pcaudiolib's People

Contributors

alex19ep avatar barracuda156 avatar brad0 avatar cmb avatar codeofdusk avatar efferifick avatar michaeltyson avatar mmerickel avatar mse2 avatar npitre avatar oniongarlic avatar ragb avatar rhdunn avatar signalsandstuff avatar sthibaul avatar syedhali avatar valdisvi avatar zment4 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pcaudiolib's Issues

Build Errors in xaudio2.cpp on Windows?

Started working on a language file for Lakota. I'm trying to build it so that I can test how it sounds before submitting. I get the following errors, which, since I didn't edit these files, seems odd...

image

Any thoughts on what is going on?

Please support windows

the windows can not build at all, please test a workable way on windows, .sh files is not work on windows,

config.status: error: cannot find input file: `Makefile.in'

Building for osx, and am a novice to C/pp build systems. Used the following command:

./autogen.sh
autoconf && ./configure
make

Which interrupts during the ./configure step, because:

configure: creating ./config.status
config.status: error: cannot find input file: `Makefile.in'
  • no other warnings/errors
  • does not seem to proceed to make

I do have Makefile.am though. Was .in supposed to be generated, should i change the .am's extension, or is the issue something else altogether?

Thanks

Trouble building on ARM-based Mac

I've encountered several build issues on MacOS running on an Apple M2 (ARM) processor:

  • When running autogen.sh, I get Makefile.am: error: required file './ChangeLog.md' not found.
    • Moving CHANGELOG.md to ChangeLog.md fixes this.
    • I get the following warnings:
configure.ac:19: warning: The macro `AC_PROG_LIBTOOL' is obsolete.
configure.ac:19: You should run autoupdate.
aclocal.m4:122: AC_PROG_LIBTOOL is expanded from...
configure.ac:19: the top level
configure.ac:36: error: possibly undefined macro: AC_DEFINE
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
  • Invocations of PKG_CHECK_MODULES fail with an error like:
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
./configure: line 12696: syntax error near unexpected token `PULSEAUDIO,'
./configure: line 12696: `        PKG_CHECK_MODULES(PULSEAUDIO, libpulse-simple >= 0.9,'

Replacing these and manually setting have_pulseaudio and have_alsa to no in the generated configure allows the build to proceed.

  • Compilation fails:
clang: warning: argument unused during compilation: '-dynamiclib' [-Wunused-command-line-argument]
  CC       src/libpcaudio_la-qsa.lo
clang: warning: argument unused during compilation: '-dynamiclib' [-Wunused-command-line-argument]
  CC       src/libpcaudio_la-oss.lo
clang: warning: argument unused during compilation: '-dynamiclib' [-Wunused-command-line-argument]
  CC       src/libpcaudio_la-pulseaudio.lo
clang: warning: argument unused during compilation: '-dynamiclib' [-Wunused-command-line-argument]
  CC       src/libpcaudio_la-audio.lo
clang: warning: argument unused during compilation: '-dynamiclib' [-Wunused-command-line-argument]
  CC       src/libpcaudio_la-coreaudio.lo
clang: warning: argument unused during compilation: '-dynamiclib' [-Wunused-command-line-argument]
src/coreaudio.c:259:9: warning: 'GetMacOSStatusCommentString' is deprecated: first deprecated in macOS 10.8 [-Wdeprecated-declarations]
        return GetMacOSStatusCommentString(error);
               ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Debugging.h:854:1: note: 'GetMacOSStatusCommentString' has been explicitly marked deprecated here
GetMacOSStatusCommentString(OSStatus err)                     __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_8, __IPHONE_NA, __IPHONE_NA);
^
1 warning generated.
  CC       src/TPCircularBuffer/libpcaudio_la-TPCircularBuffer.lo
clang: warning: argument unused during compilation: '-dynamiclib' [-Wunused-command-line-argument]
  CC       src/TPCircularBuffer/libpcaudio_la-TPCircularBuffer+AudioBufferList.lo
clang: warning: argument unused during compilation: '-dynamiclib' [-Wunused-command-line-argument]
  CCLD     src/libpcaudio.la
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: linking with (/System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio) but not using any symbols from it
ld: warning: linking with (/System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit) but not using any symbols from it
ld: -undefined dynamic_lookup cannot be used to find '_GetMacOSStatusCommentString' in dylib in dyld shared cache for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [src/libpcaudio.la] Error 1
make: *** [all] Error 2

error: expected parameter declarator, error: expected ')'

I'm not able to build pcaudiolib 1.2 on OS X 10.8 or earlier. When using the stock clang compiler included with Xcode, the error is as in #9. Using a newer clang compiler fixes that problem on OS X 10.9 but on 10.8 and earlier different errors occur, starting with:

In file included from src/TPCircularBuffer/TPCircularBuffer.c:30:
src/TPCircularBuffer/TPCircularBuffer.h:219:67: error: In file included from src/TPCircularBuffer/TPCircularBuffer+AudioBufferList.c:30:
In file included from src/TPCircularBuffer/TPCircularBuffer+AudioBufferList.h:expected parameter declarator
37:
src/TPCircularBuffer/TPCircularBuffer.h:219:67: error: expected parameter declarator
static __inline__ __attribute__((always_inline)) __deprecated_msg("use TPCircularBufferSetAtomic(false) and TPCircularBufferConsume instead")
                                                                  ^
src/TPCircularBuffer/TPCircularBuffer.h:219:67: static __inline__ __attribute__((always_inline)) __deprecated_msg("use TPCircularBufferSetAtomic(false) and TPCircularBufferConsume instead")
                                                                  ^
error: expected ')'
src/TPCircularBuffer/TPCircularBuffer.h:219src/TPCircularBuffer/TPCircularBuffer.h:219:66: note: to match this '('
:67: error: expected ')'
static __inline__ __attribute__((always_inline)) __deprecated_msg("use TPCircularBufferSetAtomic(false) and TPCircularBufferConsume instead")
                                                                 ^src/TPCircularBuffer/TPCircularBuffer.h:219:66: note
: to match this '('
static __inline__ __attribute__((always_inline)) __deprecated_msg("use TPCircularBufferSetAtomic(false) and TPCircularBufferConsume instead")
                                                                 ^
src/TPCircularBuffer/TPCircularBuffer.h:219:50: src/TPCircularBuffer/TPCircularBuffer.h:219:50: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
static __inline__ __attribute__((always_inline)) __deprecated_msg("use TPCircularBufferSetAtomic(false) and TPCircularBufferConsume instead")
~~~~~~~~~~~~~~~~~                                ^static __inline__ __attribute__((always_inline)) __deprecated_msg("use TPCircularBufferSetAtomic(false) and TPCircularBufferConsume instead")
~~~~~~~~~~~~~~~~~                                ^

src/TPCircularBuffer/TPCircularBuffer.h:219:142: error: expected ';' after top level declarator
src/TPCircularBuffer/TPCircularBuffer.h:219:142: error: expected ';' after top level declarator
static __inline__ __attribute__((always_inline)) __deprecated_msg("use TPCircularBufferSetAtomic(false) and TPCircularBufferConsume instead")
                                                                                                                                             ^
                                                                                                                                             ;

A full build log is here:

https://build.macports.org/builders/ports-10.8_x86_64-builder/builds/58025/steps/install-port/logs/stdio

Requires C11

The README says pcaudiolib requires "a functional c compiler" however that does not appear to be sufficient. It fails to build with the older versions of clang included with Xcode on OS X 10.9 and earlier:

src/TPCircularBuffer/TPCircularBuffer.h:55:14: fatal error: 'stdatomic.h' file not found
    #include <stdatomic.h>
             ^

I believe this means you actually require a C11 compiler or newer. If that's intentional, please update the readme with that requirement.

Adding support for pipewire

Hello,
pipewire is very likely to replace pulseaudio on the desktop, so it'd be useful for pcaudiolib to support it.
Samuel

Undefined symbols _GetMacOSStatusCommentString

pcaudiolib 1.2 does not build on macOS 11 ("Big Sur") or macOS 12 ("Monterey").

Undefined symbols for architecture arm64:
  "_GetMacOSStatusCommentString", referenced from:
      _coreaudio_object_strerror in libpcaudio_la-coreaudio.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [src/libpcaudio.la] Error 1

This follows an earlier warning about the same symbol:

src/coreaudio.c:259:9: warning: 'GetMacOSStatusCommentString' is deprecated: first deprecated in macOS 10.8 [-Wdeprecated-declarations]
        return GetMacOSStatusCommentString(error);
               ^
/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Debugging.h:854:1: note: 'GetMacOSStatusCommentString' has been explicitly marked deprecated here
GetMacOSStatusCommentString(OSStatus err)                     __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_10_8, __IPHONE_NA, __IPHONE_NA);
^
1 warning generated.

A full log on macOS 12 arm64 is here:

https://build.macports.org/builders/ports-12_arm64-builder/builds/24340/steps/install-port/logs/stdio

A full log on macOS 11 x86_64 is here:

https://build.macports.org/builders/ports-11_x86_64-builder/builds/53647/steps/install-port/logs/stdio

Some discussion of a possible replacement for this function is here:

https://stackoverflow.com/questions/14699604/replacements-for-getmacosstatuserrorstring-getmacosstatuscommentstring

Help requested: How do I use eSpeakNG as SAPI?

eSpeak (without NG) could be registered as a Windows SAPI voice.
"ttsengine" is still incuded in eSpeak NG, but I did not see any instruction on how to enable it.
Can anybody tell me where I can find info about this?

Pipewire breaks infrequent writers between pipewire 0.3.59 and 0.3.63

Hi. In #12 it's pointed out that explicit pipewire support is not a high priority because pipewire's pulse support is generally good enough.
Unfortunately, I've found that somewhere between pipewire 0.59 and 0.63, the way emacspeak uses libespeak-ng got broken.
I care about this a lot because emacspeak is critical for me for accessibility, and without it I don't have great ways to use terminal applications.
I've reduced things to a much simpler test case:

#include <string.h>
#include <assert.h>
#include <unistd.h>
#include <espeak-ng/speak_lib.h>
const char * a_str = "Begin";
const char * b_str = "end now";
int main() {
  unsigned int unique_identifier = 0;
  espeak_Initialize(AUDIO_OUTPUT_PLAYBACK, 512, NULL, 0);
  assert(espeak_SetParameter(espeakRATE, 550, 0) == EE_OK);
  espeak_Synth(a_str, strlen(a_str)+1, 0, POS_CHARACTER, 0,
                     espeakCHARS_UTF8 , &unique_identifier, NULL);
  sleep(3);
  espeak_Synth(b_str, strlen(b_str), 0, POS_CHARACTER, 0,
                     espeakCHARS_UTF8 , &unique_identifier, NULL);
  sleep(3);
}

Obviously that should be linked against -lespeak-ng
Under pipewire 0.59, I hear both 'begin' and 'end now'.
Under pipewire 0.63, I only hear 'begin'.
What I think is happening is that pipewire-pulse or pipewire has changed the handling of streams that underrun.

Emacspeak expects that it can generate speech whenever it likes and doesn't need to care if the audio stream underruns.
I'm reporting this against the audio library rather than espeak-ng as I suspect that's probably where the fix will end up being.
(Unless it's on the pipewire side).
I'd love to find a solution to this so we can get it into Debian for the bookworm release.
CC: @sthibaul

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.