.. contents:: Table of Contents
.. _audio:
Table audio
===========
Audio is an attempt to embed audio for multiple platform using the same interface in `Lua `__ by the engine.
Each platform uses its own native audio backend, but all share the same Lua API.
For :guilabel:`Windows` it is used `PortAudio `__.
For :guilabel:`Linux` it is used `PortAudio `__.
For :guilabel:`Android` it is used `OpenSL ES `__ (the legacy JNI audio backend has been removed).
For :guilabel:`macOS` and :guilabel:`iOS` it is used `AVFoundation `__, which supports WAV, MP3, AAC/M4A, OGG Vorbis (via stb_vorbis), AIFF, and more.
.. Important:: For `Android` only add audio in the asset folder. If you try to read audio from external device such as SD card, it has to modify the Java code for that.
audio Methods
-------------
audio new
^^^^^^^^^
.. data:: new(string file_name, boolean * in_memory, boolean * play, boolean * loop)
Create a new instance of a :ref:`audio