Skip to content

Commit

Permalink
Merge pull request #896 from IsakTheHacker/miniaudio
Browse files Browse the repository at this point in the history
Add package: miniaudio
  • Loading branch information
mhsmith committed Jul 23, 2023
2 parents 9818284 + c9b6fe3 commit e4c177a
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
10 changes: 10 additions & 0 deletions server/pypi/packages/miniaudio/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package:
name: miniaudio
version: 1.59

build:
number: 1

requirements:
build:
- cffi 1.15.1
13 changes: 13 additions & 0 deletions server/pypi/packages/miniaudio/patches/chaquopy.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- src-original/build_ffi_module.py 2023-06-04 14:39:41.000000000 +0000
+++ src/build_ffi_module.py 2023-07-23 10:11:23.154952325 +0000
@@ -828,6 +828,10 @@
Test if linker on system needs libatomic.
This has been copied from https://github.com/grpc/grpc/blob/master/setup.py#L205
"""
+ # Chaquopy: we do need libatomic, at least on x86, but this test doesn't return true
+ # for some reason.
+ return True
+
code_test = (b'#include <atomic>\n' +
b'int main() { return std::atomic<int64_t>{}; }')
cxx = shlex.split(os.environ.get('CXX', 'c++'))
12 changes: 12 additions & 0 deletions server/pypi/packages/miniaudio/test/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from os.path import dirname, join
import unittest

class TestMiniaudio(unittest.TestCase):

def test_mp3(self):
import miniaudio

info = miniaudio.mp3_get_file_info(join(dirname(__file__), "sample.mp3"))
self.assertAlmostEqual(info.duration, 10.1093878)
self.assertEqual(info.sample_format, miniaudio.SampleFormat.SIGNED16)
self.assertEqual(info.nchannels, 2)
Binary file added server/pypi/packages/miniaudio/test/sample.mp3
Binary file not shown.

0 comments on commit e4c177a

Please sign in to comment.