changeset 20694:c8ec0b72b7a6

Deprecate wavread and wavwrite. * NEWS: Announce deprecation and replacement functions. * scripts/deprecated/wavread.m, scripts/deprecated/wavwrite.m: Moved from scripts/audio. Add deprecation message to docstring. Add deprecation warning to m-file. * scripts/audio/module.mk: Remove from build system. * scripts/deprecated/module.mk: Add deprecated versions to build system. * audio.txi: Remove functions from manual.
author Rik <rik@octave.org>
date Sat, 05 Sep 2015 05:00:46 -0700
parents 54eec9c180cb
children f515bac7c7c1
files NEWS doc/interpreter/audio.txi scripts/audio/module.mk scripts/audio/wavread.m scripts/audio/wavwrite.m scripts/deprecated/module.mk scripts/deprecated/wavread.m scripts/deprecated/wavwrite.m
diffstat 6 files changed, 52 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS
+++ b/NEWS
@@ -38,6 +38,28 @@
 
       psi
 
+ ** Deprecated functions.
+
+    The following functions have been deprecated in Octave 4.2 and will
+    be removed from Octave 4.6 (or whatever version is the second major
+    release after 4.2):
+
+      Function             | Replacement
+      ---------------------|------------------
+      wavread              | audioread
+      wavwrite             | audiowrite
+
+ ** The following functions were deprecated in Octave 3.8 and have been
+    removed from Octave 4.2.
+
+      default_save_options    java_new
+      gen_doc_cache           java_unsigned_conversion
+      interp1q                javafields
+      isequalwithequalnans    javamethods
+      java_convert_matrix     re_read_readline_init_file
+      java_debug              read_readline_init_file
+      java_invoke             saving_history
+
 
 Summary of important user-visible changes for version 4.0:
 ---------------------------------------------------------
--- a/doc/interpreter/audio.txi
+++ b/doc/interpreter/audio.txi
@@ -182,6 +182,3 @@
 
 @DOCSTRING(soundsc)
 
-@DOCSTRING(wavread)
-
-@DOCSTRING(wavwrite)
--- a/scripts/audio/module.mk
+++ b/scripts/audio/module.mk
@@ -8,9 +8,7 @@
   scripts/audio/mu2lin.m \
   scripts/audio/record.m \
   scripts/audio/sound.m \
-  scripts/audio/soundsc.m \
-  scripts/audio/wavread.m \
-  scripts/audio/wavwrite.m
+  scripts/audio/soundsc.m
 
 scripts_audio_@audioplayer_FCN_FILES = \
   scripts/audio/@audioplayer/__get_properties__.m \
--- a/scripts/deprecated/module.mk
+++ b/scripts/deprecated/module.mk
@@ -19,7 +19,9 @@
   scripts/deprecated/saveaudio.m \
   scripts/deprecated/setaudio.m \
   scripts/deprecated/syl.m \
-  scripts/deprecated/usage.m
+  scripts/deprecated/usage.m \
+  scripts/deprecated/wavread.m \
+  scripts/deprecated/wavwrite.m
 
 scripts_deprecateddir = $(fcnfiledir)/deprecated
 
rename from scripts/audio/wavread.m
rename to scripts/deprecated/wavread.m
--- a/scripts/audio/wavread.m
+++ b/scripts/deprecated/wavread.m
@@ -25,6 +25,10 @@
 ## @deftypefnx {Function File} {[@dots{}] =} wavread (@dots{}, @var{datatype})
 ## @deftypefnx {Function File} {@var{sz} =} wavread (@var{filename}, "size")
 ## @deftypefnx {Function File} {[@var{n_samp}, @var{n_chan}] =} wavread (@var{filename}, "size")
+##
+## @code{wavread} is deprecated and will be removed in Octave version 4.6.
+## Use @code{audioread} for the equivalent functionality.
+##
 ## Read the audio signal @var{y} from the RIFF/WAVE sound file @var{filename}.
 ##
 ## If the file contains multichannel data, then @var{y} is a matrix with the
@@ -48,8 +52,17 @@
 ## @seealso{audioread, audiowrite, wavwrite}
 ## @end deftypefn
 
+## Deprecated in 4.2
+
 function [y, fs, nbits] = wavread (filename, varargin)
 
+  persistent warned = false;
+  if (! warned)
+    warned = true;
+    warning ("Octave:deprecated-function",
+             "wavread is obsolete and will be removed from a future version of Octave, please use audioread instead");
+  endif
+
   if (nargin < 1 || nargin > 3)
     print_usage ();
   endif
rename from scripts/audio/wavwrite.m
rename to scripts/deprecated/wavwrite.m
--- a/scripts/audio/wavwrite.m
+++ b/scripts/deprecated/wavwrite.m
@@ -21,6 +21,10 @@
 ## @deftypefn  {Function File} {} wavwrite (@var{y}, @var{filename})
 ## @deftypefnx {Function File} {} wavwrite (@var{y}, @var{fs}, @var{filename})
 ## @deftypefnx {Function File} {} wavwrite (@var{y}, @var{fs}, @var{nbits}, @var{filename})
+##
+## @code{wavwrite} is deprecated and will be removed in Octave version 4.6.
+## Use @code{audiowrite} for the equivalent functionality.
+##
 ## Write the audio signal @var{y} to the RIFF/WAVE sound file @var{filename}.
 ##
 ## If @var{y} is a matrix, the columns represent multiple audio channels.
@@ -37,8 +41,17 @@
 ## @seealso{audiowrite, audioread, wavread}
 ## @end deftypefn
 
+## Deprecated in 4.2
+
 function wavwrite (y, varargin)
 
+  persistent warned = false;
+  if (! warned)
+    warned = true;
+    warning ("Octave:deprecated-function",
+             "wavwrite is obsolete and will be removed from a future version of Octave, please use audiowrite instead");
+  endif
+
   if (nargin < 2 || nargin > 4)
     print_usage ();
   endif