Giter Site home page Giter Site logo

kivy / audiostream Goto Github PK

View Code? Open in Web Editor NEW
190.0 31.0 53.0 110 KB

Audio API for streaming raw data to speakers

Home Page: https://audiostream.readthedocs.org

License: MIT License

Python 59.71% Java 5.29% C 3.96% Objective-C 30.76% Makefile 0.27%

audiostream's Introduction

Audiostream

Audiostream is a python extension that gives you a direct access to the speaker or microphone.

The goal of this project is act as low level as possible on the audio stream:

  • You push bytes to the speaker
  • You get bytes from the microphone

Installation

This extension require Cython for the compilation. All the current examples require Kivy <http://kivy.org> to be executed.

sudo python setup.py install

Authors

audiostream's People

Contributors

aspidites avatar brousch avatar dessant avatar dustinlacewell avatar jonashaag avatar jpfep avatar keyweeusr avatar matham avatar misl6 avatar snuq avatar sufuf3 avatar tito avatar xloem 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

audiostream's Issues

build Termux

can not be Build under the Termux does not see the android platforms. can't work with $PREFIX.
does not see SDL2.

Building audiostream for Android with buildozer complains about missing files

I'm building an Android app with Kivy, the user interface builds and works great on Android, and I'm now trying to add audiostream to the project so I can record audio from the phone's microphone.

I installed audiostream with pip install git+https://github.com/kivy/audiostream and it built fine.

Then I added the same thing to my buildozer.spec as such:

requirements = python3,kivy==2.0.0,git+https://github.com/kivy/audiostream.git

However when building for Android, the following error happens:

Using legacy 'setup.py install' for audiostream, since package 'wheel' is not installed.
Installing collected packages: certifi, audiostream
    Running command /home/elver/projects/projectname/.buildozer/android/platform/build-armeabi-v7a/build/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-oqjnbbnm/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-oqjnbbnm/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-rnl0bf8z/install-record.txt --single-version-externally-managed --home /tmp/pip-target-es6qh0su --compile --install-headers /tmp/pip-target-es6qh0su/include/site/python3.8/audiostream
    Ignoring "sys._home = value" override
    Cython import ignored
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.8
    creating build/lib.linux-x86_64-3.8/audiostream
    copying audiostream/__init__.py -> build/lib.linux-x86_64-3.8/audiostream
    creating build/lib.linux-x86_64-3.8/audiostream/sources
    copying audiostream/sources/__init__.py -> build/lib.linux-x86_64-3.8/audiostream/sources
    creating build/lib.linux-x86_64-3.8/audiostream/platform
    copying audiostream/platform/__init__.py -> build/lib.linux-x86_64-3.8/audiostream/platform
    running build_ext
    building 'audiostream.platform.plat_android' extension
    creating build/temp.linux-x86_64-3.8
    creating build/temp.linux-x86_64-3.8/audiostream
    creating build/temp.linux-x86_64-3.8/audiostream/platform
    /home/elver/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -I/home/elver/projects/projectname/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include -DANDROID -D__ANDROID_API__=21 -I/home/elver/.buildozer/android/platform/android-ndk-r19c/sysroot/usr/include/arm-linux-androideabi -I/home/elver/projects/projectname/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/projectname/include/python3.8 -fPIC -I/usr/include/SDL -I/home/elver/projects/projectname/.buildozer/android/platform/build-armeabi-v7a/build/venv/include -I/usr/local/include/python3.8 -c audiostream/platform/plat_android.c -o build/temp.linux-x86_64-3.8/audiostream/platform/plat_android.o -ggdb -O2
    clang: error: no such file or directory: 'audiostream/platform/plat_android.c'
    clang: error: no input files
    error: command '/home/elver/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang' failed with exit status 1
    Running setup.py install for audiostream ... error

I've tried building audiostream with and without the USE_SDL2 flag, doing full cleans in between, but I get the same error every time.

Has anyone gotten audiostream working with buildozer on Android? How did you manage it?

ImportError: dlopen failed: cannot locate symbol "SDL_ANDROID_GetJNIEnv"

Hi
I tried the record_mac.py example provided. I also tried this code. The build process is fine and I have added audiostream to my requirements in buildozer.spec.
The problem I am facing is that the app crashes on the android device and logcat output is giving me the error.

01-17 13:37:04.206 12166 12439 I python  : Traceback (most recent call last):
01-17 13:37:04.206 12166 12439 I python  :   File "/home/test/Downloads/kivy/.buildozer/android/app/main.py", line 15, in <module>
01-17 13:37:04.207 12166 12439 I python  :   File "audiostream/core.pyx", line 236, in audiostream.core.get_input
01-17 13:37:04.208 12166 12439 I python  : ImportError: dlopen failed: cannot locate symbol "SDL_ANDROID_GetJNIEnv" referenced by "/data/data/org.test.myapp/files/app/_python_bundle/site-packages/audiostream/platform/plat_android.so"...
01-17 13:37:04.208 12166 12439 I python  : Python for android ended.

Any help is appreciated.

Linux only?

`Hello, i took a look at the install file and found:

include_dirs = ['/usr/include/SDL']

It looks very much like it would not work with windows related to the sdl paths:

#7


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

AudioOutput channels remains at value 2

Cannot set AudioOutput channels at value 1

Test program:

from kivy.core.audio import SoundLoader
from audiostream import get_output
sound = SoundLoader.load('sounds/kit1/clap.wav')
if sound:
print("Sound found at %s" % sound.source)
print("Sound is %.3f seconds" % sound.length)
sound.play()
stream = get_output(channels=1, rate=44100, buffersize=1024)
print(type(stream))

Output:

Sound found at C:...\sounds\kit1\clap.wav
Sound is 0.522 seconds
AudioOutput ask for 44100 1
AudioOutput got 44100 2

ScreenHunter_clipboard

if
stream = get_output(channels=1, rate=22050, buffersize=512)
then
AudioOutput ask for 22050 1
AudioOutput got 22050 2

Environment:

Python 3.7.3
[INFO ] [Logger ] Record log in C:\Users\User.kivy\logs\kivy_21-03-11_72.txt
[INFO ] [deps ] Successfully imported "kivy_deps.gstreamer" 0.1.18
[INFO ] [deps ] Successfully imported "kivy_deps.glew" 0.1.12
[INFO ] [deps ] Successfully imported "kivy_deps.sdl2" 0.1.23
[INFO ] [Kivy ] v1.11.1
[INFO ] [Kivy ] Installed at "C:\Users\User.pyenv\pyenv-win\versions\3.7.3\lib\site-packages\kivy_init_.py"
[INFO ] [Python ] v3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)]
[INFO ] [Python ] Interpreter at "C:\Users\User.pyenv\pyenv-win\versions\3.7.3\python.exe"
[INFO ] [AudioGstplayer] Using Gstreamer 1.16.0.0
[INFO ] [Audio ] Providers: audio_gstplayer, audio_sdl2 (audio_ffpyplayer ignored)

Windows 8.1
image

error: command 'gcc' failed with exit status 1 while installation on Windows and Ubuntu linux

On Windows installed using following way πŸ‘
D:\Programming\Installers\python\Programming_Related_installers\Python re
lated Installer\audiostream-master\audiostream-master>C:\Kivy-1.8.0-py2.7-win32
Python27\python.exe setup.py install

Hello i am from site pakages
running install
running build
running build_py
creating build
creating build\lib.win32-2.7
creating build\lib.win32-2.7\audiostream
copying audiostream__init__.py -> build\lib.win32-2.7\audiostream
creating build\lib.win32-2.7\audiostream\sources
copying audiostream\sources__init__.py -> build\lib.win32-2.7\audiostream\sourc
es
creating build\lib.win32-2.7\audiostream\platform
copying audiostream\platform__init__.py -> build\lib.win32-2.7\audiostream\plat
form
running build_ext
cythoning audiostream\sources\thread.pyx to audiostream\sources\thread.c
building 'audiostream.sources.thread' extension
creating build\temp.win32-2.7
creating build\temp.win32-2.7\Release
creating build\temp.win32-2.7\Release\audiostream
creating build\temp.win32-2.7\Release\audiostream\sources
C:\Kivy-1.8.0-py2.7-win32\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -I/usr/in
clude/SDL -I. -I/usr/include/SDL -IC:\Kivy-1.8.0-py2.7-win32\Python27\include -I
C:\Kivy-1.8.0-py2.7-win32\Python27\PC -c audiostream\sources\thread.c -o build\t
emp.win32-2.7\Release\audiostream\sources\thread.o -ggdb -O2
audiostream\sources\thread.c: In function __pyx_pf_11audiostream_7sources_6thre ad_12ThreadSource___init__': audiostream\sources\thread.c:903: warning: dereferencing type-punned pointer wil l break strict-aliasing rules audiostream\sources\thread.c:903: warning: dereferencing type-punned pointer wil l break strict-aliasing rules audiostream\sources\thread.c:903: warning: dereferencing type-punned pointer wil l break strict-aliasing rules audiostream\sources\thread.c:903: warning: dereferencing type-punned pointer wil l break strict-aliasing rules audiostream\sources\thread.c: In function__Pyx_FindPy2Metaclass':
audiostream\sources\thread.c:2408: warning: dereferencing type-punned pointer wi
ll break strict-aliasing rules
audiostream\sources\thread.c: In function `__Pyx_PyObject_IsTrue':
audiostream\sources\thread.c:3268: warning: dereferencing type-punned pointer wi
ll break strict-aliasing rules
audiostream\sources\thread.c:3269: warning: dereferencing type-punned pointer wi
ll break strict-aliasing rules
writing build\temp.win32-2.7\Release\audiostream\sources\thread.def
C:\Kivy-1.8.0-py2.7-win32\MinGW\bin\gcc.exe -mno-cygwin -shared -s build\temp.wi
n32-2.7\Release\audiostream\sources\thread.o build\temp.win32-2.7\Release\audios
tream\sources\thread.def -LC:\Kivy-1.8.0-py2.7-win32\Python27\libs -LC:\Kivy-1.8
.0-py2.7-win32\Python27\PCbuild -lSDL -lSDL_mixer -lpython27 -lmsvcr90 -o build
lib.win32-2.7\audiostream\sources\thread.pyd
C:\Kivy-1.8.0-py2.7-win32\MinGW\bin..\lib\gcc\mingw32\3.4.5........\mingw32
\bin\ld.exe: cannot find -lSDL
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

On Linux :

kivy@kivy-VirtualBox:/python_installers/audiostream-master$ sudo python setup.py install
[sudo] password for kivy:
running install
running build
running build_py
creating build/lib.linux-i686-2.7
creating build/lib.linux-i686-2.7/audiostream
copying audiostream/init.py -> build/lib.linux-i686-2.7/audiostream
creating build/lib.linux-i686-2.7/audiostream/sources
copying audiostream/sources/init.py -> build/lib.linux-i686-2.7/audiostream/sources
creating build/lib.linux-i686-2.7/audiostream/platform
copying audiostream/platform/init.py -> build/lib.linux-i686-2.7/audiostream/platform
running build_ext
skipping 'audiostream/sources/thread.c' Cython extension (up-to-date)
building 'audiostream.sources.thread' extension
creating build/temp.linux-i686-2.7
creating build/temp.linux-i686-2.7/audiostream
creating build/temp.linux-i686-2.7/audiostream/sources
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/SDL -I. -I/usr/include/SDL -I/usr/include/python2.7 -c audiostream/sources/thread.c -o build/temp.linux-i686-2.7/audiostream/sources/thread.o -ggdb -O2
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-i686-2.7/audiostream/sources/thread.o -lSDL -lSDL_mixer -o build/lib.linux-i686-2.7/audiostream/sources/thread.so
/usr/bin/ld: cannot find -lSDL
/usr/bin/ld: cannot find -lSDL_mixer
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
kivy@kivy-VirtualBox:
/python_installers/audiostream-master$

Get_bytes call too many times

Hello ,
Before anything thanks for the works done on this AudioStream module.

I have an issue that i can't find a solution. I have a python Kivy app who use the Threadsource method. so i cut my sound in step

1 step = 1/4 BPM = (samplerate 15/BPM) samples so it should call the function Get_bytes 4BPM but it's call way more so my sound is read very fast can you help me ?

Thanks in advance

Cant install this module on windows 11

I am installing the package inside a virtual environment using the pipenv tool.

My error looks like this.

PS C:\workspace\clones\MrBeat_GOT\library\audiostream_pc\audiostream> pipenv install -e git+https://github.com/kivy/audiostream.git#egg=audiostream
Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning.
Installing -e git+https://github.com/kivy/audiostream.git#egg=audiostream...
Error:  An error occurred while installing -e git+https://github.com/kivy/audiostream.git#egg=audiostream!
Error text: Obtaining audiostream from git+https://github.com/kivy/audiostream.git#egg=audiostream (from -r c:\users\dayone\appdata\local\temp\pipenv-yy2x7dez-requirements\pipenv-iv7tcmbi-requirement.txt (line 1))
  Cloning https://github.com/kivy/audiostream.git to c:\workspace\clones\mrbeat_got\library\audiostream_pc\audiostream\src\audiostream
  Resolved https://github.com/kivy/audiostream.git to commit 69f6b100f1ea4e3982a1acf6bbb0804e31a2cd50
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Installing collected packages: audiostream
  Running setup.py develop for audiostream

  Running command git clone --filter=blob:none -q https://github.com/kivy/audiostream.git 'C:\workspace\clones\MrBeat_GOT\library\audiostream_pc\audiostream\src\audiostream'
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\dayone\AppData\Local\Programs\Python\Python39\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\workspace\\clones\\MrBeat_GOT\\library\\audiostream_pc\\audiostream\\src\\audiostream\\setup.py'"'"'; __file__='"'"'C:\\workspace\\clones\\MrBeat_GOT\\library\\audiostream_pc\\audiostream\\src\\audiostream\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
         cwd: C:\workspace\clones\MrBeat_GOT\library\audiostream_pc\audiostream\src\audiostream\
    Complete output (37 lines):
    running develop
    running egg_info
    creating audiostream.egg-info
    writing audiostream.egg-info\PKG-INFO
    writing dependency_links to audiostream.egg-info\dependency_links.txt
    writing top-level names to audiostream.egg-info\top_level.txt
    writing manifest file 'audiostream.egg-info\SOURCES.txt'
    adding license file 'LICENSE' (matched pattern 'LICEN[CS]E*')
    reading manifest file 'audiostream.egg-info\SOURCES.txt'
    writing manifest file 'audiostream.egg-info\SOURCES.txt'
    running build_ext
    cythoning audiostream\sources\thread.pyx to audiostream\sources\thread.c
    C:\Users\dayone\AppData\Local\Programs\Python\Python39\lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\workspace\clones\MrBeat_GOT\library\audiostream_pc\audiostream\src\audiostream\audiostream\sources\thread.pyx
      tree = Parsing.p_module(s, pxd, full_module_name)
    cythoning audiostream\sources\wave.pyx to audiostream\sources\wave.c
    C:\Users\dayone\AppData\Local\Programs\Python\Python39\lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\workspace\clones\MrBeat_GOT\library\audiostream_pc\audiostream\src\audiostream\audiostream\sources\wave.pyx
      tree = Parsing.p_module(s, pxd, full_module_name)
    cythoning audiostream\sources\puredata.pyx to audiostream\sources\puredata.c
    C:\Users\dayone\AppData\Local\Programs\Python\Python39\lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\workspace\clones\MrBeat_GOT\library\audiostream_pc\audiostream\src\audiostream\audiostream\sources\puredata.pyx
      tree = Parsing.p_module(s, pxd, full_module_name)
    cythoning audiostream\core.pyx to audiostream\core.c
    C:\Users\dayone\AppData\Local\Programs\Python\Python39\lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\workspace\clones\MrBeat_GOT\library\audiostream_pc\audiostream\src\audiostream\audiostream\core.pyx
      tree = Parsing.p_module(s, pxd, full_module_name)
    warning: audiostream\ringbuffer.pxi:144:14: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
    warning: audiostream\ringbuffer.pxi:144:27: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
    building 'audiostream.sources.thread' extension
    creating build
    creating build\temp.win-amd64-3.9
    creating build\temp.win-amd64-3.9\Release
    creating build\temp.win-amd64-3.9\Release\audiostream
    creating build\temp.win-amd64-3.9\Release\audiostream\sources
    C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I/usr/include/SDL -I. -I/usr/include/SDL -IC:\Users\dayone\AppData\Local\Programs\Python\Python39\include -IC:\Users\dayone\AppData\Local\Programs\Python\Python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt /Tcaudiostream\sources\thread.c /Fobuild\temp.win-amd64-3.9\Release\audiostream\sources\thread.obj -ggdb -O2
    cl : Command line warning D9002 : ignoring unknown option '-ggdb'
    thread.c
    C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Users\dayone\AppData\Local\Programs\Python\Python39\libs /LIBPATH:C:\Users\dayone\AppData\Local\Programs\Python\Python39\PCbuild\amd64 /LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\lib\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\ucrt\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\um\x64 SDL.lib SDL_mixer.lib /EXPORT:PyInit_thread build\temp.win-amd64-3.9\Release\audiostream\sources\thread.obj /OUT:C:\workspace\clones\MrBeat_GOT\library\audiostream_pc\audiostream\src\audiostream\audiostream\sources\thread.cp39-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.9\Release\audiostream\sources\thread.cp39-win_amd64.lib
    LINK : fatal error LNK1181: cannot open input file 'SDL.lib'
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\link.exe' failed with exit code 1181
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\dayone\AppData\Local\Programs\Python\Python39\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\workspace\\clones\\MrBeat_GOT\\library\\audiostream_pc\\audiostream\\src\\audiostream\\setup.py'"'"'; __file__='"'"'C:\\workspace\\clones\\MrBeat_GOT\\library\\audiostream_pc\\audiostream\\src\\audiostream\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.

Installation Failed

iOS audio signal processing - how to turn off?

I have built an audio spectrum analyser using audiostream and kivy, this is working well. However, iOS does some signal processing by default and has a low cut filter on all microphone input. How can I by-pass this processing?
I understand that I need to set the AudioSession category and measurement mode but I am unsure how to approach this. Can someone please help or point me in the right direction?

Issue recording audio after outputting audio - iOS

There appears to be an issue whereby mic.poll() does not call the callback function of 'get_input(callback = callbackFunction, rate = rate, buffersize = buffersize) after using the speaker's on my iPhone to output audio.

My code works fine recording audio with no previous activity, but if I use the audiostream's AudioOutput module or Kivy's SoundLoader module and try to record audio again using get_input, then mic.poll() fails and no buffer data is sent to the callback function of get_input. I imagine this issue is to do with how the phone is re-configured when it's speakers are used, as, if I do not output any audio, I can record audio using audiostream an infinite number of times.

Here is my code to record the audio:

def __init__(self, **kw):
    super().__init__(**kw)
    self.samples_per_second = 60 # variables which stores the number of audio samples recorded per second
    self.audioData = [] # creates a list to store the audio bytes recorded
    import sys
    importlib.reload(sys.modules['audiostream']) # reloads the audiostream module - thought this might solve the problem; it doesn't!!
    self.mic = get_input(callback=self.micCallback, rate=8000, source='default', buffersize=2048) # initialises the method get_input from the module 'audiostream' with the properties required to ensure the audio is recorded correctly

def micCallback(self, buffer):
    # method which is called by the method 'get_input' to store recorded audio data (each buffer of audio samples)
    self.audioData.append(buffer) # appends each buffer (chunk of audio data) to variable 'self.audioData'

def start(self):
    # method which begins the process of recording the audio data
    self.mic.start() # starts the method 'self.mic' recording audio data
    Clock.schedule_interval(self.readChunk, 1 / self.samples_per_second) # calls the method 'self.readChunk' to read and store each audio buffer (2048 samples) 60 times per second

def readChunk(self, sampleRate):
    # method which coordinates the reading and storing of the bytes from each buffer of audio data (which is a chunk of 2048 samples)
    self.mic.poll()  # calls 'get_input(callback=self.mic_callback, source='mic', buffersize=2048)' to read the byte content. This byte content is then dispatched to the callback method 'self.micCallback'

def stop(self):
    # method which terminates and saves the audio recording when the recording has been successful
    Clock.unschedule(self.readChunk) # un-schedules the Clock's rythmic execution of the 'self.readChunk' callback
    self.mic.stop() # stops recording audio
    return self.audioData

Here is the code I have used to output audio after using the above code to record audio:

messageFile_voice = SoundLoader.load("filename.wav")
messageFile_voice.play()

Is it possible to use audiostream in service?

I'm building some sound generating app for android which uses audiostream module and it works fine in main app, but not in service. When i start service it crashes with error message:
SDL_Init: Application didn't initialize properly, did you include SDL_main.h in the file containing your main() function?

This message is returned by SDL, and it means SDL_SetMainReady is False, which sets to True on main app init. So SDL must be initialized again, but for service? If yes, please advise me how to do it.

failed to install

Cython version 0.21.1

sudo python setup.py install
running install
running build
running build_py
running build_ext
cythoning audiostream/sources/thread.pyx to audiostream/sources/thread.c

Error compiling Cython file:

...
import cython, array

^

audiostream/sources/thread.pyx:1:7: Compiler crash in AnalyseDeclarationsTransform

File 'ModuleNode.py', line 103, in analyse_declarations: ModuleNode(thread.pyx:1:0,
full_module_name = 'audiostream.sources.thread')
File 'Nodes.py', line 387, in analyse_declarations: StatListNode(thread.pyx:1:0)
File 'Nodes.py', line 387, in analyse_declarations: StatListNode(thread.pyx:1:15)
File 'Nodes.py', line 6920, in analyse_declarations: CImportStatNode(thread.pyx:1:7,
as_name = u'cython',
module_name = u'cython')

Compiler crash traceback from this point on:
File "/usr/local/lib/python2.7/dist-packages/Cython/Compiler/Nodes.py", line 6920, in analyse_declarations
module_scope = env.find_module(self.module_name, self.pos)
File "/usr/local/lib/python2.7/dist-packages/Cython/Compiler/Symtab.py", line 1101, in find_module
module_name, relative_to=None if relative_level == 0 else self.parent_module, pos=pos)
File "/usr/local/lib/python2.7/dist-packages/Cython/Compiler/Main.py", line 140, in find_module
pxd_pathname = self.find_pxd_file(qualified_name, pos)
File "/usr/local/lib/python2.7/dist-packages/Cython/Compiler/Main.py", line 192, in find_pxd_file
pxd = self.search_include_directories(qualified_name, ".pxd", pos, sys_path=True)
File "/usr/local/lib/python2.7/dist-packages/Cython/Compiler/Main.py", line 233, in search_include_directories
tuple(self.include_directories), qualified_name, suffix, pos, include, sys_path)
File "/usr/local/lib/python2.7/dist-packages/Cython/Utils.py", line 22, in wrapper
res = cache[args] = f(*args)
File "/usr/local/lib/python2.7/dist-packages/Cython/Utils.py", line 111, in search_include_directories
path = os.path.join(dir, dotted_filename)
File "/usr/lib/python2.7/posixpath.py", line 80, in join
path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 12: ordinal not in range(128)
building 'audiostream.sources.thread' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/SDL -I. -I/usr/include/SDL -I/usr/include/python2.7 -c audiostream/sources/thread.c -o build/temp.linux-x86_64-2.7/audiostream/sources/thread.o -ggdb -O2
audiostream/sources/thread.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
#error Do not use this file, it is the result of a failed Cython compilation.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

JNI RegisterNatives called with pending exception java.lang.ClassNotFoundException: Didn't find class "org.audiostream.AudioIn"

Hi, I've created a Google colab so you can simply recreate the error.

My code is:

from audiostream import get_input
from android.permissions import request_permissions, Permission
request_permissions([Permission.RECORD_AUDIO])
def mic_callback(buf):
    print("got", len(buf))
print("KEYWORD_TO_SEARCH_IN_ADB_LOGCAT")
mic = get_input(callback=mic_callback)

but in adb logcat I read:

02-25 10:53:48.359 1299 1568 F org.test.myapp: java_vm_ext.cc:570] JNI DETECTED ERROR IN APPLICATION: JNI RegisterNatives called with pending exception java.lang.ClassNotFoundException: Didn't find class "org.audiostream.AudioIn" on path: DexPathList[[zip file "/data/app/org.test.myapp-VZcDiTQAVptYQlU1RG8YjQ==/base.apk"],nativeLibraryDirectories=[/data/app/org.test.myapp-VZcDiTQAVptYQlU1RG8YjQ==/lib/arm, /data/app/org.test.myapp-VZcDiTQAVptYQlU1RG8YjQ==/base.apk!/lib/armeabi-v7a, /system/lib, /system/product/lib]]

and then, the application crashed.

Thanks for your help. I believe that if we create a working google colab it can also be integrated into the homepage to be used as a starting point.

Can't record

Running this bit of code:

def mic_callback(buf):
print 'got', len(buf)
frames.append(buf)
print ('size of frames: ' + len(frames))

def bcallback(instance):

    mic = get_input(callback=mic_callback, source='mic')
    mic.start()

    #mic.poll()
    time.sleep(5)

    mic.stop()

class MyApp(App):
def build(self):

    btn1 = Button(text='Audio Record')
    btn1.bind(on_press=bcallback)

    return btn1

if name == 'main':
MyApp().run()

and using logcat I can see that mic_callback isn't working since there isn't any print on logcat.

I've tried to change source to 'default' also, but doesn't work either.

cant compile for android

Just discovered the audiostream package, and it's awesome. Sadly can't build for Android (at least from OS X...) log below.


$ buildozer android_new debug
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Search for Git (git)
#  -> found at /usr/bin/git
# Search for Cython (cython)
#  -> found at /Library/Frameworks/Python.framework/Versions/2.7/bin/cython
# Search for Java compiler (javac)
#  -> found at /System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/javac
# Search for Java keytool (keytool)
#  -> found at /System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/keytool
# Install platform
# Apache ANT found at /Users/macbookpro/apache-ant-1.9.7/bin
# Android SDK found at /Users/macbookpro/Library/Android/sdk
# Android NDK found at /Users/macbookpro/Library/Android/ndk-r12b
# Check application requirements
# Check garden requirements
# Compile platform
# Run 'python -m pythonforandroid.toolchain --color=always --storage-dir=/Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build create --dist_name=learningkivy --bootstrap=sdl2 --requirements=kivy,python2,audiostream --arch armeabi-v7a --copy-libs'
# Cwd /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master
[INFO]:    Will compile for the following archs: armeabi-v7a
[INFO]:    Found Android API target in $ANDROIDAPI
[INFO]:    Available Android APIs are (19, 20, 21, 22, 23)
[INFO]:    Requested API target 19 is available, continuing.
[INFO]:    Found NDK dir in $ANDROIDNDK
[INFO]:    Got NDK version from $ANDROIDNDKVER
[INFO]:    Using Google NDK r9c
[INFO]:    Found virtualenv at /Library/Frameworks/Python.framework/Versions/2.7/bin/virtualenv
[INFO]:    Found the following toolchain versions: ['4.9']
[INFO]:    Picking the latest gcc toolchain, here 4.9
[WARNING]: Missing executable: libtoolize is not installed
[INFO]:    No existing dists meet the given requirements!
[INFO]:    No dist exists that meets your requirements, so one will be built.
[INFO]:    Bootstrap requires recipes ['sdl2', ('python2', 'python3crystax')]
[INFO]:    Loaded recipe sdl2 (depends on [('python2', 'python3crystax'), 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf'], conflicts ['sdl', 'pygame', 'pygame_bootstrap_components'])
[INFO]:    Loaded recipe kivy (depends on ['pyjnius', ('sdl2', 'pygame'), ('python2', 'python3crystax')])
[INFO]:    Loaded recipe audiostream (depends on ['pyjnius', ('python2', 'python3crystax'), ('sdl', 'sdl2'), 'python2'])
[INFO]:    Loaded recipe python2 (depends on ['hostpython2'], conflicts ['python3crystax', 'python3'])
[INFO]:    Loaded recipe sdl2_image (depends on [])
[INFO]:    Loaded recipe sdl2_mixer (depends on [])
[INFO]:    Loaded recipe sdl2_ttf (depends on [])
[INFO]:    Loaded recipe pyjnius (depends on ['six', ('sdl2', 'sdl', 'genericndkbuild'), ('python2', 'python3crystax')])
[INFO]:    Loaded recipe hostpython2 (depends on [], conflicts ['hostpython3'])
[INFO]:    Loaded recipe six (depends on [('python2', 'python3crystax')])
[INFO]:    Found a single valid recipe set (this is good)
[INFO]:    The selected bootstrap is sdl2
[INFO]:    # Creating dist with sdl2 bootstrap
[INFO]:    Dist will have name learningkivy and recipes (kivy, python2, audiostream)
[INFO]:    -> running cp -r /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-fo...(and 163 more)
[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python2
[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master
[INFO]:    Recipe build order is ['hostpython2', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'python2', 'sdl2', 'six', 'pyjnius', u'audiostream', u'kivy']
[INFO]:    # Downloading recipes 
[INFO]:    Downloading hostpython2
[INFO]:    -> running mkdir -p /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/...(and 20 more)
[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/hostpython2
[INFO]:    -> running basename http://python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2
[INFO]:    hostpython2 download already cached, skipping                                                                          
[WARNING]: Should check headers here! Skipping for now.
[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master
[INFO]:    Downloading sdl2_image
[INFO]:    -> running mkdir -p /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/...(and 19 more)
[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/sdl2_image
[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.1.tar.gz
[INFO]:    sdl2_image download already cached, skipping                                                                           
[WARNING]: Should check headers here! Skipping for now.
[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master
[INFO]:    Downloading sdl2_mixer
[INFO]:    -> running mkdir -p /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/...(and 19 more)
[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/sdl2_mixer
[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.tar.gz
[INFO]:    sdl2_mixer download already cached, skipping                                                                           
[WARNING]: Should check headers here! Skipping for now.
[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master
[INFO]:    Downloading sdl2_ttf
[INFO]:    -> running mkdir -p /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/sdl2_ttf
[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/sdl2_ttf
[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.0.14.tar.gz
[INFO]:    sdl2_ttf download already cached, skipping                                                                             
[WARNING]: Should check headers here! Skipping for now.
[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master
[INFO]:    Downloading python2
[INFO]:    -> running mkdir -p /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/python2
[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/python2
[INFO]:    -> running basename http://python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2
[INFO]:    python2 download already cached, skipping                                                                              
[WARNING]: Should check headers here! Skipping for now.
[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master
[INFO]:    Downloading sdl2
[INFO]:    -> running mkdir -p /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/sdl2
[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/sdl2
[INFO]:    -> running basename https://www.libsdl.org/release/SDL2-2.0.4.tar.gz
[INFO]:    sdl2 download already cached, skipping                                                                                 
[WARNING]: Should check headers here! Skipping for now.
[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master
[INFO]:    Downloading six
[INFO]:    -> running mkdir -p /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/six
[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/six
[INFO]:    -> running basename https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz
[INFO]:    six download already cached, skipping                                                                                  
[WARNING]: Should check headers here! Skipping for now.
[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master
[INFO]:    Downloading pyjnius
[INFO]:    -> running mkdir -p /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/pyjnius
[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/pyjnius
[INFO]:    -> running basename https://github.com/kivy/pyjnius/archive/master.zip
[INFO]:    pyjnius download already cached, skipping                                                                              
[WARNING]: Should check headers here! Skipping for now.
[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master
[INFO]:    Downloading audiostream
[INFO]:    -> running mkdir -p /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/...(and 20 more)
[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/audiostream
[INFO]:    -> running basename https://github.com/kivy/audiostream/archive/master.zip
[INFO]:    audiostream download already cached, skipping                                                                          
[WARNING]: Should check headers here! Skipping for now.
[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master
[INFO]:    Downloading kivy
[INFO]:    -> running mkdir -p /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/kivy
[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/packages/kivy
[INFO]:    -> running basename https://github.com/kivy/kivy/archive/master.zip
[INFO]:    kivy download already cached, skipping                                                                                 
[WARNING]: Should check headers here! Skipping for now.
[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master
[INFO]:    # Building all recipes for arch armeabi-v7a
[INFO]:    # Unpacking recipes
[INFO]:    Unpacking hostpython2 for armeabi-v7a
[INFO]:    -> running basename http://python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2
[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop
[INFO]:    hostpython2 is already unpacked, skipping
[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master
[INFO]:    Unpacking sdl2_image for armeabi-v7a
[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.1.tar.gz
[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python2/jni
[INFO]:    sdl2_image is already unpacked, skipping
[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master
[INFO]:    Unpacking sdl2_mixer for armeabi-v7a
[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.tar.gz
[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python2/jni
[INFO]:    sdl2_mixer is already unpacked, skipping
[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master
[INFO]:    Unpacking sdl2_ttf for armeabi-v7a
[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.0.14.tar.gz
[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python2/jni
[INFO]:    sdl2_ttf is already unpacked, skipping
[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master
[INFO]:    Unpacking python2 for armeabi-v7a
[INFO]:    -> running basename http://python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2
[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/build/other_builds/python2/armeabi-v7a
[INFO]:    python2 is already unpacked, skipping
[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master
[INFO]:    Unpacking sdl2 for armeabi-v7a
[INFO]:    -> running basename https://www.libsdl.org/release/SDL2-2.0.4.tar.gz
[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python2/jni
[INFO]:    sdl2 is already unpacked, skipping
[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master
[INFO]:    Unpacking six for armeabi-v7a
[INFO]:    -> running basename https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz
[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/build/other_builds/six-python2/armeabi-v7a
[INFO]:    six is already unpacked, skipping
[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master
[INFO]:    Unpacking pyjnius for armeabi-v7a
[INFO]:    -> running basename https://github.com/kivy/pyjnius/archive/master.zip
[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/build/other_builds/pyjnius-python2-sdl2/armeabi-v7a
[INFO]:    pyjnius is already unpacked, skipping
[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master
[INFO]:    Unpacking audiostream for armeabi-v7a
[INFO]:    -> running basename https://github.com/kivy/audiostream/archive/master.zip
[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/build/other_builds/audiostream-python2-sdl2/armeabi-v7a
[INFO]:    audiostream is already unpacked, skipping
[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master
[INFO]:    Unpacking kivy for armeabi-v7a
[INFO]:    -> running basename https://github.com/kivy/kivy/archive/master.zip
[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/build/other_builds/kivy-python2-sdl2/armeabi-v7a
[INFO]:    kivy is already unpacked, skipping
[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master
[INFO]:    # Prebuilding recipes
[INFO]:    Prebuilding hostpython2 for armeabi-v7a
[INFO]:    -> running cp /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-a...(and 193 more)
[INFO]:    Prebuilding sdl2_image for armeabi-v7a
[INFO]:    sdl2_image has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for sdl2_image[armeabi-v7a]
[INFO]:    sdl2_image already patched, skipping
[INFO]:    Prebuilding sdl2_mixer for armeabi-v7a
[INFO]:    sdl2_mixer has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for sdl2_mixer[armeabi-v7a]
[INFO]:    sdl2_mixer already patched, skipping
[INFO]:    Prebuilding sdl2_ttf for armeabi-v7a
[INFO]:    sdl2_ttf has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding python2 for armeabi-v7a
[INFO]:    python2 has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for python2[armeabi-v7a]
[INFO]:    python2 already patched, skipping
[INFO]:    Prebuilding sdl2 for armeabi-v7a
[INFO]:    sdl2 has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for sdl2[armeabi-v7a]
[INFO]:    sdl2 already patched, skipping
[INFO]:    Prebuilding six for armeabi-v7a
[INFO]:    six has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding pyjnius for armeabi-v7a
[INFO]:    pyjnius has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for pyjnius[armeabi-v7a]
[INFO]:    pyjnius already patched, skipping
[INFO]:    Prebuilding audiostream for armeabi-v7a
[INFO]:    audiostream has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding kivy for armeabi-v7a
[INFO]:    kivy has no prebuild_armeabi_v7a, skipping
[INFO]:    # Building recipes
[INFO]:    Building hostpython2 for armeabi-v7a
[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2
[INFO]:    hostpython already exists, skipping build
[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master
[INFO]:    Building sdl2_image for armeabi-v7a
[INFO]:    Building sdl2_mixer for armeabi-v7a
[INFO]:    Building sdl2_ttf for armeabi-v7a
[INFO]:    Building python2 for armeabi-v7a
[INFO]:    Copying hostpython binary to targetpython folder
[INFO]:    -> running cp /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/build/...(and 178 more)
[INFO]:    Building sdl2 for armeabi-v7a
[INFO]:    -> directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python2/jni
[INFO]:    -> running ndk-build V=1
ccache found, will optimize builds
('path is', '/Users/macbookpro/Library/Android/ndk-r12b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86/bin/:/Users/macbookpro/Library/Android/ndk-r12b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/:/Users/macbookpro/Library/Android/ndk-r12b:/Users/macbookpro/Library/Android/sdk/tools:/Users/macbookpro/apache-ant-1.9.7/bin/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/macbookpro/bin:/Users/macbookpro/apache-ant-1.9.7/bin:/Users/macbookpro/Library/Android/sdk/tools:/Users/macbookpro/Library/Android/sdk/platform-tools')
[INFO]:    <- directory context /Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master       
[INFO]:    Building six for armeabi-v7a
[INFO]:    Python package already exists in site-packages
[INFO]:    six said it is already built, skipping
[INFO]:    Building pyjnius for armeabi-v7a
[INFO]:    Python package already exists in site-packages
[INFO]:    pyjnius said it is already built, skipping
[INFO]:    Building audiostream for armeabi-v7a
[INFO]:    audiostream apparently isn't already in site-packages
[INFO]:    Cythonizing anything necessary in audiostream
('name is', None, <class 'pythonforandroid.recipes.six.SixRecipe'>)
('name is', 'jnius', <class 'pythonforandroid.recipes.pyjnius.PyjniusRecipe'>)
('name is', None, <class 'pythonforandroid.recipes.audiostream.AudiostreamRecipe'>)
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 829, in <module>
    main()
  File "/Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 826, in main
    ToolchainCL()
  File "/Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 483, in __init__
    getattr(self, args.subparser_name.replace('-', '_'))(args)
  File "/Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 146, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 189, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx)
  File "pythonforandroid/build.py", line 562, in build_recipes
    recipe.build_arch(arch)
  File "pythonforandroid/recipe.py", line 958, in build_arch
    self.build_cython_components(arch)
  File "pythonforandroid/recipe.py", line 964, in build_cython_components
    env = self.get_recipe_env(arch)
  File "/Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/python-for-android-master/pythonforandroid/recipes/audiostream/__init__.py", line 25, in get_recipe_env
    raise RuntimeError('Audiostream library is not yet able to configure itself to link against SDL2.  Patch on audiostream library needed - any help much appreciated!')
RuntimeError: Audiostream library is not yet able to configure itself to link against SDL2.  Patch on audiostream library needed - any help much appreciated!
# Command failed: python -m pythonforandroid.toolchain --color=always --storage-dir=/Users/macbookpro/Projects/learn-kivy/.buildozer/android/platform/build create --dist_name=learningkivy --bootstrap=sdl2 --requirements=kivy,python2,audiostream --arch armeabi-v7a --copy-libs
# 
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/38340278-cant-compile-for-android?utm_campaign=plugin&utm_content=tracker%2F77121&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F77121&utm_medium=issues&utm_source=github).

AudioInput on mac

I used the iOS code to add an AudioInput class for Mac. The changes are here:

https://github.com/pbouda/audiostream

I would send a pull request if you think it makes sense to integrate the code. Here is what I did:

  1. I copied the iOS code and adapted the classes so that it works on Mac. The main difference is the code to find the default audio device.

  2. I had to add GIL handling to the C++ code (see for example the callback), otherwise the code crashed after calling the C++ callback.

  3. Some minor changes in setup.py to compile on "darwin" platforms. I added the include path to the brew SDL.

  4. I added an example that writes a wave file based on the input, to see if my code works. Maybe not necessary for a pull request...?

https://github.com/pbouda/audiostream/blob/master/examples/record_mac.py

Probably some code could be shared between iOS and Mac OS, but I would leave that to later work...

audio recording

Hi,
I tried the audio recording example but I have some problems.

In Android I have RECORD_AUDIO permission in AndroidManifest.xml and buildozer build the apk, but the app exit without record anything...

any advice?

ModuleNotFoundError: No module named 'audiostream.core' Tried on python3 and python2

I'm having problems installing audiostream on Ubuntu 20.10
first tried installing for python3 and got this error when importing audiostream :
import audiostream
outputs :

Traceback (most recent call last):
File "", line 1, in
File "/home/gorou92/audiostream/audiostream/audiostream/init.py", line 19, in
from audiostream.core import *
ModuleNotFoundError: No module named 'audiostream.core'

and in python2

Traceback (most recent call last):
File "", line 1, in
File "audiostream/init.py", line 19, in
from audiostream.core import *
ImportError: No module named core

installation on windows

running install
running build
running build_py
running build_ext
skipping 'audiostream\sources\thread.c' Cython extension (up-to-date)
skipping 'audiostream\sources\wave.c' Cython extension (up-to-date)
skipping 'audiostream\sources\puredata.c' Cython extension (up-to-date)
skipping 'audiostream\core.c' Cython extension (up-to-date)
building 'audiostream.sources.thread' extension
error: Unable to find vcvarsall.bat

I used python setup.py install by changing directory via cmd

Add project infrastructure

audiostream needs a lot of project infrastructure:

  • There is no pypi package.
  • There is no documentation.
  • There is no information about platforms supported.
  • There are zero unit tests.
  • There are no CI actions.

Python3 support

Hello,

It seems that audiostream is not yet ready for python3. I tried to fix a few errors but then my knowledge found its limits.

  1. In sources directory, two files have problems with arrays (waves.pyx and puredata.pyx):
    search for lines like that :
    buf = array('h', '\x00' * self.chunksize)
    It seems that this is easy to fix by just adding a 'b':
    buf = array('h', b'\x00' * self.chunksize)
    There are a few iterations only of them.

  2. Then in waves.pyx there are a few uses of "next" that is no more valid in python3. I tried to change them with the new syntax but it was not sufficient or proper I am afraid.

fail to install

Have installed Kivy, and now trying to install Audiostream, but get an error:

>pip3 install git+https://github.com/kivy/audiostream.git
Collecting git+https://github.com/kivy/audiostream.git
  Cloning https://github.com/kivy/audiostream.git to /tmp/pip-uhs2_2ti-build
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-uhs2_2ti-build/setup.py", line 22
        print 'Cython import ignored'
                                    ^
    SyntaxError: Missing parentheses in call to 'print'

Why this could happened?
I have Cython v0.26

>pip3 list | grep Cython
Cython (0.26)

Problem installing in Ubuntu 12.04 /usr/bin/ld: cannot find -lSDL /usr/bin/ld: cannot find -lSDL_mixer

I have problems installing the project. Am I missing some package or symbolic link?

This is what I got:
sudo python setup.py install
running install
running build
running build_py
running build_ext
skipping 'audiostream/sources/thread.c' Cython extension (up-to-date)
building 'audiostream.sources.thread' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/SDL -I. -I/usr/include/SDL -I/usr/include/python2.7 -c audiostream/sources/thread.c -o build/temp.linux-x86_64-2.7/audiostream/sources/thread.o -ggdb -O2
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-x86_64-2.7/audiostream/sources/thread.o -lSDL -lSDL_mixer -o build/lib.linux-x86_64-2.7/audiostream/sources/thread.so
/usr/bin/ld: cannot find -lSDL
/usr/bin/ld: cannot find -lSDL_mixer
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

Android. Promlem with build and problem with mic.

If I try build from source:

requirements = python3, kivy==2.0.0, Cython, jnius, pyVoIP, git+https://github.com/kivy/python-for-android.git, sh, colorama, git+https://github.com/kivy/audiostream.git

I have got some problem:

/usr/bin/ccache /home/djvu/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -I/home/djvu/workspace/intercom/phone/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include -DANDROID -D__ANDROID_API__=21 -I/home/djvu/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/aarch64-linux-android -I/home/djvu/workspace/intercom/phone/.buildozer/android/platform/build-arm64-v8a/build/python-installs/kivy_test/arm64-v8a/include/python3.8 -fPIC -I/usr/include/SDL -I/home/djvu/workspace/intercom/phone/.buildozer/android/platform/build-arm64-v8a/build/venv/include -I/usr/local/include/python3.8 -c audiostream/platform/plat_android.c -o build/temp.linux-x86_64-3.8/audiostream/platform/plat_android.o -ggdb -O2
  clang: error: no such file or directory: 'audiostream/platform/plat_android.c'
  clang: error: no input files
  error: command '/usr/bin/ccache' failed with exit status 1
  error: subprocess-exited-with-error
  
  Γ— Running setup.py install for audiostream did not run successfully.
  β”‚ exit code: 1
  ╰─> See above for output.

If I try build with:

requirements = python3, kivy==2.0.0, Cython, jnius, pyVoIP, git+https://github.com/kivy/python-for-android.git, sh, colorama, audiostream

Build will be OK, but I can't get data from mic. Π‘allback was not called.

Code:

import os
import sys
import time
import wave
import types
import requests
import ctypes, ctypes.util

import kivy
kivy.require("1.9.1")
from kivy.app import App
from kivy.uix.button import Button
from kivy.utils import platform

from time import sleep
from jnius import autoclass

from audiostream import get_input

class ButtonApp(App):

    def build(self):
        # use a (r, g, b, a) tuple
        btn = Button(text ="Push Me !",
                   font_size ="20sp",
                   background_color = (1, 1, 1, 1),
                   color = (1, 1, 1, 1),
                   size_hint = (.2, .1),
                   pos_hint = {'x':.4, 'y':.45})

        # bind() use to bind the button to function callback
        btn.bind(on_press = self.callback)
        return btn

    # callback function tells when button pressed
    def callback(self, event):
        exit(0)

# declare a callback where we'll receive the data
def callback_mic(data):
    print("callback_mic')
    print("i got', len(data))

if __name__ == "__main__":
    # get the microphone (or from another source if available)
    mic = get_input(callback=callback_mic, source='mic')
    mic.start()
    sleep(5)
    mic.stop()

    ButtonApp().run()

Can you help me? Thx.

failed install on mac

Hi,
I am attempting to install audiostream using, on my Mac (OS Ventura 13.5.2):
pip install git+https://github.com/kivy/audiostream.git

I get the following error.

Building wheels for collected packages: audiostream
  Building wheel for audiostream (setup.py) ... error
  error: subprocess-exited-with-error
  
  Γ— python setup.py bdist_wheel did not run successfully.
  β”‚ exit code: 1
  ╰─> [65 lines of output]
      Compiling audiostream/platform/plat_mac.pyx because it changed.
      [1/1] Cythonizing audiostream/platform/plat_mac.pyx
      /Users/USER/anaconda3/lib/python3.11/site-packages/Cython/Compiler/Main.py:384: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /private/var/folders/nc/k8_d0krn429dlxj8p5b1z7pc0000gn/T/pip-req-build-7q4uztmh/audiostream/platform/plat_mac.pyx
        tree = Parsing.p_module(s, pxd, full_module_name)
      warning: audiostream/platform/../config.pxi:1:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See https://github.com/cython/cython/issues/4310
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              if py_audio_callback is None:
                  return
              py_audio_callback(buf[:buffersize])
      
      cdef void init():
          audiostream_cy_register(cy_audio_callback)
                                  ^
      ------------------------------------------------------------
      
      audiostream/platform/plat_mac.pyx:36:28: Cannot assign type 'void (char *, int) except * nogil' to 'audio_callback_t'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (char *, int) except * nogil'.
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/nc/k8_d0krn429dlxj8p5b1z7pc0000gn/T/pip-req-build-7q4uztmh/setup.py", line 103, in <module>
          setup(
        File "/Users/USER/anaconda3/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/Users/USER/anaconda3/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/Users/USER/anaconda3/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/Users/USER/anaconda3/lib/python3.11/site-packages/setuptools/dist.py", line 1244, in run_command
          super().run_command(command)
        File "/Users/USER/anaconda3/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/Users/USER/anaconda3/lib/python3.11/site-packages/wheel/bdist_wheel.py", line 325, in run
          self.run_command("build")
        File "/Users/USER/anaconda3/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/Users/USER/anaconda3/lib/python3.11/site-packages/setuptools/dist.py", line 1244, in run_command
          super().run_command(command)
        File "/Users/USER/anaconda3/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/Users/USER/anaconda3/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 131, in run
          self.run_command(cmd_name)
        File "/Users/USER/anaconda3/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/Users/USER/anaconda3/lib/python3.11/site-packages/setuptools/dist.py", line 1244, in run_command
          super().run_command(command)
        File "/Users/USER/anaconda3/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/Users/USER/anaconda3/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
          self.build_extensions()
        File "/Users/USER/anaconda3/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions
          self._build_extensions_serial()
        File "/Users/USER/anaconda3/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial
          self.build_extension(ext)
        File "/Users/USER/anaconda3/lib/python3.11/site-packages/Cython/Distutils/build_ext.py", line 122, in build_extension
          new_ext = cythonize(
                    ^^^^^^^^^^
        File "/Users/USER/anaconda3/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1134, in cythonize
          cythonize_one(*args)
        File "/Users/USER/anaconda3/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1301, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: audiostream/platform/plat_mac.pyx
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for audiostream
  Running setup.py clean for audiostream
Failed to build audiostream
ERROR: Could not build wheels for audiostream, which is required to install pyproject.toml-based projects

I tried following the advice given here

>sudo apt-get install libsdl1.2-dev
>sudo apt-get install libsdl-mixer1.2-dev

...which apparently on mac is something like:

brew install SDL2
brew install SDL2_image
brew install SDL2_ttf
brew install sdl2_mixer  

...but alas, I still get the error.

Linker error on MacOS Ventura 13.4.1

Hello,
I tried to install your library on MacOS Ventura with Python 3.9 (Anaconda). Unfortunately it resulted in a linker error, please see below. Any advices are much appreciated, thank you!

warning: audiostream/ringbuffer.pxi:144:14: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
warning: audiostream/ringbuffer.pxi:144:27: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
audiostream/platform/mac_ext.m:77:2: warning: 'PyEval_InitThreads' is deprecated [-Wdeprecated-declarations]
PyEval_InitThreads();
^
/Users/a/opt/anaconda3/include/python3.9/ceval.h:130:1: note: 'PyEval_InitThreads' has been explicitly marked deprecated here
Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
^
/Users/a/opt/anaconda3/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
^
audiostream/platform/mac_ext.m:132:14: warning: 'AudioHardwareGetProperty' is deprecated: first deprecated in macOS 10.6 [-Wdeprecated-declarations]
status = AudioHardwareGetProperty(
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardwareDeprecated.h:342:1: note: 'AudioHardwareGetProperty' has been explicitly marked deprecated here
AudioHardwareGetProperty( AudioHardwarePropertyID inPropertyID,
^
audiostream/platform/mac_ext.m:168:34: warning: 'AudioUnitSampleType' is deprecated: The concept of canonical formats is deprecated [-Wdeprecated-declarations]
size_t bytesPerSample = sizeof (AudioUnitSampleType);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioBaseTypes.h:191:1: note: 'AudioUnitSampleType' has been explicitly marked deprecated here
CA_CANONICAL_DEPRECATED typedef Float32 AudioUnitSampleType;
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioBaseTypes.h:29:52: note: expanded from macro 'CA_CANONICAL_DEPRECATED'
#define CA_CANONICAL_DEPRECATED attribute((deprecated("The concept of canonical formats is deprecated")))
^
audiostream/platform/mac_ext.m:168:9: warning: unused variable 'bytesPerSample' [-Wunused-variable]
size_t bytesPerSample = sizeof (AudioUnitSampleType);
^
4 warnings generated.
ld: library not found for -lSDL
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/clang' failed with exit code 1

changing number of channels causes a frequency change in SineSource

Generating a sine wave as shown in the first blocks of the sine example in
http://audiostream.readthedocs.org/en/latest/#examples
and changing the number of channels from 1 to 2 or from 2 to 1 changes the frequency (half and double, respectively).

I tried to dive into the code and think it is because the AudioSample class and the AudioOutput class (from audiostream.core) can have different channel settings (variables .channels and .channel, respectively).


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

ThreadSource error

When I try to run the sinslider example I get this error:

I/python (13506): File "/home/andre/.buildozer/android/app/main.py", line 5, in
I/python (13506): File "audiostream/sources/wave.pyx", line 5, in init audiostream.sources.wave (audiostream/sources/wave.c:3438)
I/python (13506): ImportError: cannot import name ThreadSource

Any workaround for this?

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/26871697-threadsource-error?utm_campaign=plugin&utm_content=tracker%2F77121&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F77121&utm_medium=issues&utm_source=github).

sound is crackled

I'm making a sound classification android app by using kivy and audiostream module.

But when I recorded the sound from outside through mic, the sound is crackled (The sound is kind of cut off).
I change the devices and tried other things but still sound is unclear.
Do you how to make the sound smoothly? (I checked the document but there was no function for that.)
or is there anyway to solve it?

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.