-int mm_sound_pa_read(const int handle, void* buf, const int size)
-{
- mm_sound_handle_t* phandle = NULL;
- int err = MM_ERROR_NONE;
-
-#ifdef __STREAM_DEBUG__
- debug_msg("handle(%d), buf(%p), size(%d)", handle, buf, size);
-#endif
- if (buf == NULL)
- return MM_ERROR_INVALID_ARGUMENT;
-
- if (size < 0)
- return MM_ERROR_INVALID_ARGUMENT;
- else if (size == 0)
- return size;
-
- CHECK_HANDLE_RANGE(handle);
- GET_HANDLE_DATA(phandle, mm_sound_handle_mgr.handles, &handle, __mm_sound_handle_comparefunc);
- if(phandle == NULL) {
- debug_msg("phandle is null");
- return MM_ERROR_SOUND_INTERNAL;
- }
-
- if (0 > pa_simple_read(phandle->s, buf, size, &err)) {
- debug_error("pa_simple_read() failed with %s", pa_strerror(err));
- return MM_ERROR_SOUND_INTERNAL;
- }
-
- return size;
-}
-
-EXPORT_API