summaryrefslogtreecommitdiff
path: root/plugins/ao/readme.txt
blob: 5f7bd4d83ac1a392f655800d66a1eea6f220e770 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
this version of AOSDK is not the original work.
main change is that all engines had been made reentrant to work correctly in deadbeef player

=== original AOSDK readme starts here === 

it has STL code stripped off, + many bug fixes that are not upstream (yet)
for original AdPlug information see below

Audio Overload SDK - Development Release 1.4.8  February 15, 2009

Copyright (c) 2007-2009 R. Belmont and Richard Bannister.
All rights reserved.
=========================================================

Please refer to license.txt for the specific licensing details of this software.

This SDK opens up some of the music file format engines developed for the Audio Overload project.
You may use this code to play the formats on systems we don't support or inside of applications 
other than AO.

Configurables in the makefile:

- Uncomment the line that defines LONG_IS_64BIT for compilation on 64-bit Linux, *BSD, and other operating
systems using the AMD64 recommended ABI (not 64-bit Windows).

- Change LSB_FIRST=1 to =0 for big-endian platforms.

New in Release 1.4.8
- Guard against invalid data sometimes created by makessf.py (fixes crashing Pebble Beach ST-V rips)


Entry points of an AO engine are as follows:

int32 XXX_start(uint8 *, uint32)

This function attempts to recognize and load a file of a specific type.  It is assumed external code has 
already checked the file's signature in cases where that's possible.  The first parameter is a pointer to
the entire file in memory, and the second is the length of the file.  The return value is AO_SUCCESS if 
the engine properly loaded the file and AO_FAIL if it didn't.


int32 XXX_gen(int16 *, uint32)

This function actually plays the song and generates signed 16-bit stereo samples at 44100 Hz.  The first 
parameter is a pointer to a buffer in which to place the samples (stereo interleaved), and the second is
the number of stereo samples to generate (so the output buffer size must be (number of samples) * 2 * 2
bytes in length).


int32 XXX_stop(void)

This function ceases playback and cleans up the engine.  You must call _start again after this to play more
music.


int32 XXX_command(int32, int32)

For some engines, this allows you to send commands while a song is playing.  The first parameter is the 
command (these are defined in ao.h), the second is the parameter.  These commands are as follows:

COMMAND_PREV (parameter ignored) - for file formats which have more than one song in a file (NSF), this 
moves back one song.

COMMAND_NEXT (parameter ignored) - for file formats which have more than one song in a file (NSF), this 
moves forward one song.

COMMAND_RESTART	(parameter ignored) - Restarts the current song from the beginning.  Not supported by 
all engines.

COMMAND_HAS_PREV (parameter ignored) - for file formats which have more than one song in a file (NSF),
this checks if moving backwards from the current song is a valid operation.  (Returns AO_FAIL if not)

COMMAND_HAS_NEXT (parameter ignored) - for file formats which have more than one song in a file (NSF),
this checks if moving forward from the current song is a valid operation.  (Returns AO_FAIL if not)

COMMAND_GET_MIN (parameter ignored) - for file formats which have more than one song in a file (NSF), 
this returns the lowest valid song number.

COMMAND_GET_MAX (parameter ignored) - for file formats which have more than one song in a file (NSF), 
this returns the highest valid song number.

COMAND_JUMP - for file formats which have more than one song in a file (NSF), this command jumps directly
to a specific song number, which is passed in as the parameter.


int32 XXX_fillinfo(ao_display_info *)

This function fills out the ao_display_info struct (see ao.h for details) with information about the currently
playing song.  The information provided varies by engine.