| 78 | } |
| 79 | |
| 80 | public String getError(int vorbisErrorCode) { |
| 81 | switch (vorbisErrorCode) { |
| 82 | case STBVorbis.VORBIS__no_error: |
| 83 | return "VORBIS_no_error"; |
| 84 | case STBVorbis.VORBIS_need_more_data: |
| 85 | return "VORBIS_need_more_data"; |
| 86 | case STBVorbis.VORBIS_invalid_api_mixing: |
| 87 | return "VORBIS_invalid_api_mixing"; |
| 88 | case STBVorbis.VORBIS_outofmem: |
| 89 | return "VORBIS_outofmem"; |
| 90 | case STBVorbis.VORBIS_feature_not_supported: |
| 91 | return "VORBIS_feature_not_supported"; |
| 92 | case STBVorbis.VORBIS_too_many_channels: |
| 93 | return "VORBIS_too_many_channels"; |
| 94 | case STBVorbis.VORBIS_file_open_failure: |
| 95 | return "VORBIS_file_open_failure"; |
| 96 | case STBVorbis.VORBIS_seek_without_length: |
| 97 | return "VORBIS_seek_without_length"; |
| 98 | case STBVorbis.VORBIS_unexpected_eof: |
| 99 | return "VORBIS_unexpected_eof"; |
| 100 | case STBVorbis.VORBIS_seek_invalid: |
| 101 | return "VORBIS_seek_invalid"; |
| 102 | case STBVorbis.VORBIS_invalid_setup: |
| 103 | return "VORBIS_invalid_setup"; |
| 104 | case STBVorbis.VORBIS_invalid_stream: |
| 105 | return "VORBIS_invalid_stream"; |
| 106 | case STBVorbis.VORBIS_missing_capture_pattern: |
| 107 | return "VORBIS_missing_capture_pattern"; |
| 108 | case STBVorbis.VORBIS_invalid_stream_structure_version: |
| 109 | return "VORBIS_invalid_stream_structure_version"; |
| 110 | case STBVorbis.VORBIS_continued_packet_flag_invalid: |
| 111 | return "VORBIS_continued_packet_flag_invalid"; |
| 112 | case STBVorbis.VORBIS_incorrect_stream_serial_number: |
| 113 | return "VORBIS_incorrect_stream_serial_number"; |
| 114 | case STBVorbis.VORBIS_invalid_first_page: |
| 115 | return "VORBIS_invalid_first_page"; |
| 116 | case STBVorbis.VORBIS_bad_packet_type: |
| 117 | return "VORBIS_bad_packet_type"; |
| 118 | case STBVorbis.VORBIS_cant_find_last_page: |
| 119 | return "VORBIS_cant_find_last_page"; |
| 120 | case STBVorbis.VORBIS_seek_failed: |
| 121 | return "VORBIS_seek_failed"; |
| 122 | case STBVorbis.VORBIS_ogg_skeleton_not_supported: |
| 123 | return "VORBIS_ogg_skeleton_not_supported"; |
| 124 | default: |
| 125 | return "Unknown error code: " + vorbisErrorCode; |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | public void close() { |
| 130 | if (sampleBuffer != null) |