History

readme: add high-level API doc.

lieff committed 8 years ago

Commit 86d13931 parent 45a1de91 file · +26 −0Browse files

Unified · Split

README.md+26−0
@@ -149,6 +149,32 @@ lack ID3 tags, which allows us to decode the first frame and calculate all frame · 148 unmodified lines
149positions as ``frame_bytes * N``. However, because of padding, frames can differ149positions as ``frame_bytes * N``. However, because of padding, frames can differ
150in size even in this case.150in size even in this case.
151 151
152## High-level API
153
154If you need only decode file/buffer, you can use optional high-level API.
155Just ``#include`` ``minimp3_ex.h`` instead and use following additional functions:
156
157```
158typedef struct
159{
160 int16_t *buffer;
161 size_t samples; /* channels included, byte size = samples*sizeof(int16_t) */
162 int channels, hz, layer, avg_bitrate_kbps;
163} mp3dec_file_info_t;
164
165/* decode whole buffer block */
166void mp3dec_load_buf(mp3dec_t *dec, const uint8_t *buf, size_t buf_size, mp3dec_file_info_t *info);
167/* iterate through frames with optional decoding */
168void mp3dec_iterate_buf(const uint8_t *buf, size_t buf_size, MP3D_ITERATE_CB callback, void *user_data);
169#ifndef MINIMP3_NO_STDIO
170/* stdio versions with file pre-load */
171int mp3dec_iterate(const char *file_name, MP3D_ITERATE_CB callback, void *user_data);
172int mp3dec_load(mp3dec_t *dec, const char *file_name, mp3dec_file_info_t *info);
173#endif
174```
175
176Use MINIMP3_NO_STDIO define to exclude STDIO functions.
177
152## Bindings178## Bindings
153 179
154 * https://github.com/tosone/minimp3 - go bindings180 * https://github.com/tosone/minimp3 - go bindings

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t