Skip to content

Commit

Permalink
ext: add libsamplerate library
Browse files Browse the repository at this point in the history
Adds libsamplerate library that allows to resample audio streams to
different samplerate.
  • Loading branch information
KKopyscinski committed Mar 4, 2024
1 parent e55baf9 commit 59ce2f4
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 0 deletions.
44 changes: 44 additions & 0 deletions ext/libsamplerate/include/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

#ifndef H_LIBSAMPLERATE_CONFIG_
#define H_LIBSAMPLERATE_CONFIG_

#include "syscfg/syscfg.h"

#if MYNEWT_VAL(ENABLE_SINC_BEST_CONVERTER)
#define ENABLE_SINC_BEST_CONVERTER 1
#endif

#if MYNEWT_VAL(ENABLE_SINC_MEDIUM_CONVERTER)
#define ENABLE_SINC_MEDIUM_CONVERTER 1
#endif

#if MYNEWT_VAL(ENABLE_SINC_FAST_CONVERTER)
#define ENABLE_SINC_FAST_CONVERTER 1
#endif

#if MYNEWT_VAL(LIBSAMPLER_NDEBUG)
#define LIBSAMPLER_NDEBUG 1
#endif

#define PACKAGE "libsamplerate"
#define VERSION "0.2.2"

#endif /* H_LIBSAMPLERATE_CONFIG_ */
57 changes: 57 additions & 0 deletions ext/libsamplerate/pkg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

pkg.name: ext/libsamplerate
pkg.description: samplerate library
pkg.author: "Apache Mynewt <dev@mynewt.apache.org>"
pkg.homepage: "http://mynewt.apache.org/"
pkg.keywords:
- samplerate

pkg.type: sdk

pkg.cflags: -DHAVE_STDBOOL_H -fsingle-precision-constant -DHAVE_CONFIG_H
pkg.cflags.ENABLE_SINC_BEST_CONVERTER: -DENABLE_SINC_BEST_CONVERTER
pkg.cflags.ENABLE_SINC_MEDIUM_CONVERTER: -DENABLE_SINC_MEDIUM_CONVERTER
pkg.cflags.ENABLE_SINC_FAST_CONVERTER: -DENABLE_SINC_FAST_CONVERTER
pkg.cflags.LIBSAMPLER_NDEBUG: -DNDEBUG
pkg.lflags: -lm

pkg.ign_dirs:
- "@libsamplerate/Octave"
- "@libsamplerate/Win32"
- "@libsamplerate/cmake"
- "@libsamplerate/docs"
- "@libsamplerate/examples"
- "@libsamplerate/include"
- "@libsamplerate/m4"
- "@libsamplerate/tests"

pkg.src_dirs:
- "@libsamplerate/src"

pkg.include_dirs:
- "@libsamplerate/include"

repository.libsamplerate:
type: github
vers: 0.2.2-commit
branch: release-0.2.2
user: libsndfile
repo: libsamplerate
30 changes: 30 additions & 0 deletions ext/libsamplerate/syscfg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

syscfg.defs:
ENABLE_SINC_BEST_CONVERTER:
description: Enable SINC best converter
value: 1
ENABLE_SINC_MEDIUM_CONVERTER:
description: Enable SINC medium converter
value: 1
ENABLE_SINC_FAST_CONVERTER:
description: Enable SINC fastest converter
value: 1
LIBSAMPLER_NDEBUG:
description: Define NDEBUG for resampler code (turns off asserts)
value: 0

0 comments on commit 59ce2f4

Please sign in to comment.