Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Libcwav 3DS: Difference between revisions

From GameBrew
No edit summary
No edit summary
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Infobox 3DS homebrew
{{Infobox 3DS Homebrews
| title = Libcwav
|title=Libcwav
| image = https://dlhb.gamebrew.org/3dshomebrew/Libcwav.jpg|250px
|image=Libcwav2.png
| type = Media players
|description=A 3DS library to play BCWAV files.
| version = 1.0 (27 Jan 2021)
|author=PabloMK7 (mariohackandglitch)
| licence = Mixed
|lastupdated=2021/01/27
| author = mariohackandglitch
|type=Media Players
| website = https://github.com/mariohackandglitch/libcwav
|version=1.0
| download = https://dlhb.gamebrew.org/3dshomebrew/Libcwav.rar
|license=Mixed
| source = https://dlhb.gamebrew.org/3dshomebrew/Libcwav.rar
|download=https://dlhb.gamebrew.org/3dshomebrews/libcwav.7z
|website=https://github.com/mariohackandglitch/libcwav
|source=https://github.com/mariohackandglitch/libcwav
}}
}}
libcwav is a library for playing (b)cwav files on the 3DS.  
libcwav is a library for playing (b)cwav files on the 3DS.  


Line 46: Line 47:


==Credits==
==Credits==
[https://github.com/devkitPro/libctru libctru] - CSND and DSP implementation.
* [https://github.com/devkitPro/libctru libctru] - CSND and DSP implementation.
 
* [https://www.3dbrew.org/wiki/BCWAV 3dbrew.org] - (b)cwav file specification.
[https://www.3dbrew.org/wiki/BCWAV 3dbrew.org] - (b)cwav file specification.
 
[[Category:3DS homebrew applications]]
[[Category:Homebrew media players on 3DS]]

Latest revision as of 06:26, 6 Mayıs 2024

Libcwav
Libcwav2.png
General
AuthorPabloMK7 (mariohackandglitch)
TypeMedia Players
Version1.0
LicenseMixed
Last Updated2021/01/27
Links
Download
Website
Source

libcwav is a library for playing (b)cwav files on the 3DS.

The goal of this library is to provide an interface for playing (b)cwav files in 3DS homebrew sofware. The way it is designed allows to play these files in non-application environments, such as 3GX game plugins or applets, as it provides support for the CSND system service. Unlike (b)cstm files which are streamed in chunks from their storage media, (b)cwav files are fully loaded into the linear RAM. Therefore, (b)cwav files are only meant for small sound effects. This library provides support for the ADPCM encodings, which heavily reduce the required memory to play the file.

Building

Make sure you have devkitpro installed and working.

  • Clone or download the repo and open a command prompt. Run make install and confirm there aren't any errors.
  • In your project makefile, add the following to the LIBDIRS line (or similar): $(DEVKITPRO)/libcwav
  • In your project makefile, add the following to the LIBS line (or similar): -lcwav if the already listed libraries start with -l or just cwav if they don't.
  • Add #include "cwav.h" and/or #include "cwav_file.h" in your source files to use the library.

You can check all the available function calls in the documentation provided in .h|cwav.h and cwav_file.h. Also, you can see an example application in example_libcwav.

User guide

CWAV Audio Encodings

The following audio encodings are supported.

  • PCM8/PCM16 - Uncompressed 8/16 bit PCM. Useful if memory usage is not a problem.
  • DSP ADPCM - Lossy compression format, useful if the available memory is limited. Can only be played with DSP.
  • IMA ADPCM - Lossy compression format, similar to DSP ADPCM. Can only be played with CSND.

System Services

The following system services used to play the audio are supported.

  • DSP - This system service is used by normal applications. It is recommended to use this system service, as it properly supports suspending applications and sleep mode.
  • CSND - This system service is used by applets to play audio. It has the advantage of playing audio on top of running/suspended applications, whitout causing any interferences.
    • Use this system service if you want to play audio in applets or 3GX game plugins.
    • Make sure to use cwavDoAptHook() or cwavNotifyAptEvent() to handle apt events (app suspend, sleep or exit).

Create (b)cwav files

You can use cwavtool to create (b)cwav files from other audio formats. It supports all possible encodings and loop points.

Changelog

v1.0 2021/01/27

  • Initial release.

Credits

Advertising: