Mercurial > octave-antonio
changeset 19813:879cff0c05dc
audiowrite: Accept a row vector input as a single channel
* audioread.cc (Faudiowrite): Accept a row vector input as a single channel.
author | Mike Miller <mtmiller@ieee.org> |
---|---|
date | Sat, 21 Feb 2015 11:53:41 -0500 |
parents | f9ca80482c41 |
children | 71770cf07c30 |
files | libinterp/dldfcn/audioread.cc |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/dldfcn/audioread.cc Sat Feb 21 11:31:55 2015 -0500 +++ b/libinterp/dldfcn/audioread.cc Sat Feb 21 11:53:41 2015 -0500 @@ -306,7 +306,7 @@ if (error_state) return retval; - const Matrix audio = args(1).matrix_value (); + Matrix audio = args(1).matrix_value (); if (error_state) return retval; @@ -336,6 +336,9 @@ sf_count_t items_to_write = audio.rows () * audio.columns (); + if (audio.rows () == 1) + audio = audio.transpose (); + OCTAVE_LOCAL_BUFFER (float, data, items_to_write); sf_count_t idx = 0;