BASS is an audio library (written in C and C++) developed by Un4seen Developments. See un4seen.com for downloads, documentation, licensing terms, and a User Forum.
CBass is a Swift package that seamlessly integrates the BASS audio library and its extensive collection of extensions into your Swift projects. With CBass, you can harness the power of BASS's robust audio capabilities with the ease and convenience of Swift.
CBass provides pre-built Swift modules for the following BASS extensions and add-ons:
Bass 2.14.17
The Main APIs of Bass which includes the bass.xcframework
& libbass.xcframeworks
binaries and the public bass.h
header.
BASSFLAC 2.4.5.5
An extension enabling the playback of FLAC (including Ogg FLAC) encoded files and streams.
BASSMIDI 2.4.14.1
An extension enabling the playback of MIDI files and custom event sequences, using SF2 and SFZ soundfonts to provide the sounds, including support for SF2PACK and SF3 compressed soundfonts. MIDI input is also supported.
BASSWV 2.4.7.4
An extension enabling the playback of WavPack encoded files and streams, including WavPack DSD files when used with the BASSDSD add-on.
BASSOPUS 2.4.2.4
An extension enabling the playback of Opus encoded files and streams.
BASSDSD 2.4.1.3
An extension enabling the playback of DSD (Direct Stream Digital) data in
DSDIFF
and DSF
containers, and WavPack when used with the BASSWV
add-on.
Includes raw DSD
and DSD-over-PCM
output options.
BASSHLS 2.4.4
An extension enabling the playback of HLS (HTTP Live Streaming) streams. Local media playlists and segments are also supported.
BASSAPE 2.4
An extension enabling the playback of Monkey's Audio encoded files.
BASSmix 2.4.12
An extension providing the ability to mix together multiple BASS channels, with resampling and matrix mixing features. Also provides the ability to split a BASS channel into multiple channels.
BASSenc 2.4.16.1
An extension that allows BASS channels to be encoded using command-line encoders with
STDIN
support, or ACM codecs (on Windows) or CoreAudio codecs (on macOS/iOS
),
or user-provided encoders.
Also features streaming of encoded data to clients directly or via Shoutcast and
Icecast servers, and PCM
WAV/AIFF
file writing.
BASSenc_MP3 2.4.1.6
An extension to BASSenc
that provides MP3 encoding of BASS channels, with support for LAME
options.
BASSenc_FLAC 2.4.4.1
An extension to BASSenc that provides FLAC encoding of BASS channels, including support for Ogg FLAC and chained bitstreams.
BASSenc_OGG 2.4.2
An extension to BASSenc that provides Ogg Vorbis encoding of BASS channels, with support for OGGENC options and chained bitstreams.
BASSenc_OPUS 2.4.3
An extension to BASSenc that provides Opus encoding of BASS channels, with support for OPUSENC options and chained bitstreams.
BASSloud 2.4
An extension providing loudness measurement of BASS channels.
BASS FX 2.4.12.6
An extension providing several effects, including reverse playback and tempo & pitch control.
BASS_MPC 2.4.1.2
An extension enabling the playback of Musepack encoded files and streams.
BASS_TTA 2.4.0.2
An extension enabling the playback of TTA encoded files.
BASS_VST 2.4.1
An extension enabling the use of VST effects and instruments with BASS.
MacOS Only
Tags 19
An extension producing formatted text from the
ID3v1/v2
, OGG/FLAC
, WMA
, APE
, MP4
, and RIFF
tags of a BASS stream.
To import BASS into your Xcode project, click on "File | Add Package Dependencies...". In the resultant pop-up window, type "github.com/Teatra11/CBass" as the repository url, and click on "Add Package". Then type "import CBass" at the top of any class in the project using BASS library commands.
To be clear, the CBass Swift Package wrapper is open source, but the wrapper's contents (mainly the files bass.xcframework, libbass.xcframework, bass.h, bridge.c, and bridge.h) are proprietary to Un4seen Developments. Usage of these files is free for non-commercial use. Commercial developers should contact Un4seen Developments to arrange proper licensing.
SwiftCBassDemo is a simple Swift app that imports the CBass package and demonstrates how to use it. See here for the source code.