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
149149 positions as ``frame_bytes * N``. However, because of padding, frames can differ
150150 in size even in this case.
151151
152+## High-level API
153+
154+If you need only decode file/buffer, you can use optional high-level API.
155+Just ``#include`` ``minimp3_ex.h`` instead and use following additional functions:
156+
157+```
158+typedef 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 */
166+void 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 */
168+void 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 */
171+int mp3dec_iterate(const char *file_name, MP3D_ITERATE_CB callback, void *user_data);
172+int mp3dec_load(mp3dec_t *dec, const char *file_name, mp3dec_file_info_t *info);
173+#endif
174+```
175+
176+Use MINIMP3_NO_STDIO define to exclude STDIO functions.
177+
152178 ## Bindings
153179
154180 * 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