Changeset 1433ecda in mainline for uspace/app/wavplay
- Timestamp:
- 2018-04-04T15:42:37Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2c4e1cc
- Parents:
- 47b2d7e3
- Location:
- uspace/app/wavplay
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/wavplay/main.c
r47b2d7e3 r1433ecda 89 89 90 90 /* Allocate buffer and create new context */ 91 char * 91 char *buffer = malloc(READ_SIZE); 92 92 if (!buffer) { 93 93 fclose(source); … … 211 211 */ 212 212 static const struct option opts[] = { 213 { "device", required_argument, 0, 'd'},214 { "parallel", no_argument, 0, 'p'},215 { "record", no_argument, 0, 'r'},216 { "help", no_argument, 0, 'h'},217 { 0, 0, 0, 0}213 { "device", required_argument, 0, 'd' }, 214 { "parallel", no_argument, 0, 'p' }, 215 { "record", no_argument, 0, 'r' }, 216 { "help", no_argument, 0, 'h' }, 217 { 0, 0, 0, 0 } 218 218 }; 219 219 … … 222 222 * @param name Name of the program. 223 223 */ 224 static void print_help(const char *name)224 static void print_help(const char *name) 225 225 { 226 226 printf("Usage: %s [options] file [files...]\n", name); … … 293 293 if (ret != EOK) { 294 294 printf("Failed to connect hound context to default " 295 "target.\n");295 "target.\n"); 296 296 hound_context_destroy(hound_ctx); 297 297 return 1; … … 324 324 if (!data) { 325 325 printf("Playback of %s failed.\n", 326 326 file); 327 327 continue; 328 328 } -
uspace/app/wavplay/wave.c
r47b2d7e3 r1433ecda 118 118 const unsigned size = uint16_t_le2host(header->sample_size); 119 119 switch (size) { 120 case 8: *format = PCM_SAMPLE_UINT8; break; 121 case 16: *format = PCM_SAMPLE_SINT16_LE; break; 122 case 24: *format = PCM_SAMPLE_SINT24_LE; break; 123 case 32: *format = PCM_SAMPLE_SINT32_LE; break; 120 case 8: 121 *format = PCM_SAMPLE_UINT8; 122 break; 123 case 16: 124 *format = PCM_SAMPLE_SINT16_LE; 125 break; 126 case 24: 127 *format = PCM_SAMPLE_SINT24_LE; 128 break; 129 case 32: 130 *format = PCM_SAMPLE_SINT32_LE; 131 break; 124 132 default: 125 133 *error = "Unknown format"; -
uspace/app/wavplay/wave.h
r47b2d7e3 r1433ecda 90 90 } wave_header_t; 91 91 92 errno_t wav_parse_header(const void *, const void **, size_t *, unsigned *,92 errno_t wav_parse_header(const void *, const void **, size_t *, unsigned *, 93 93 unsigned *, pcm_sample_format_t *, const char **); 94 94 95 void wav_init_header(wave_header_t *, pcm_format_t 95 void wav_init_header(wave_header_t *, pcm_format_t, size_t); 96 96 #endif 97 97 /**
Note:
See TracChangeset
for help on using the changeset viewer.