亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? mp3read.m

?? mp3 read and write matlab code
?? M
字號:
function [Y,FS,NBITS,OPTS] = mp3read(FILE,N,MONO,DOWNSAMP,DELAY)% MP3READ   Read MP3 audio file via use of external binaries.%   Y = MP3READ(FILE) reads an mp3-encoded audio file into the%     vector Y just like wavread reads a wav-encoded file (one channel %     per column).  Extension ".mp3" is added if FILE has none.%     Also accepts other formats of wavread, such as%   Y = MP3READ(FILE,N) to read just the first N sample frames (N%     scalar), or the frames from N(1) to N(2) if N is a two-element vector.  %   Y = MP3READ(FILE,FMT) or Y = mp3read(FILE,N,FMT) %     with FMT as 'native' returns int16 samples instead of doubles; %     FMT can be 'double' for default behavior (to exactly mirror the%     syntax of wavread).%%   [Y,FS,NBITS,OPTS] = MP3READ(FILE...) returns extra information:%     FS is the sampling rate,  NBITS is the bit depth (always 16), %     OPTS.fmt is a format info string; OPTS has multiple other%     fields, see WAVREAD.%%   SIZ = MP3READ(FILE,'size') returns the size of the audio data contained%     in the file in place of the actual audio data, returning the%     2-element vector SIZ=[samples channels].%%   [Y...] = MP3READ(FILE,N,MONO,DOWNSAMP,DELAY) extends the%     WAVREAD syntax to allow access to special features of the%     mpg123 engine:  MONO = 1 forces output to be mono (by%     averaging stereo channels); DOWNSAMP = 2 or 4 downsamples by %     a factor of 2 or 4 (thus FS returns as 22050 or 11025%     respectively for a 44 kHz mp3 file); DELAY controls how many%     "warm up" samples to drop at the start of the file; the%     default value of 2257 makes an mp3write/mp3read loop for a 44%     kHz mp3 file be as close as possible to being temporally%     aligned; specify as 0 to prevent discard of initial samples.%%   [Y...] = MP3READ(URL...)  uses the built-in network%     functionality of mpg123 to read an MP3 file across the%     network.  URL must be of the form 'http://...' or%     'ftp://...'.  'size' and OPTS are not available in this mode.%%   Example:%   To read an mp3 file as doubles at its original width and sampling rate:%     [Y,FS] = mp3read('piano.mp3');%   To read the first 1 second of the same file, downsampled by a%   factor of 4, cast to mono, using the default filename%   extension:%     [Y,FS4] = mp3read('piano', FS/4, 1, 4);%%   Note: Because the mp3 format encodes samples in blocks of 26 ms (at%   44 kHz), and because of the "warm up" period of the encoder,%   the file length may not be exactly what you expect.%%   Note: requires external binaries mpg123 and mp3info; you%   can find binaries for several platforms at:%     http://labrosa.ee.columbia.edu/matlab/mp3read.html%%   See also mp3write, wavread.% $Header: /Users/dpwe/matlab/columbiafns/RCS/mp3read.m,v 1.4 2009/03/15 18:23:37 dpwe Exp dpwe $% 2003-07-20 dpwe@ee.columbia.edu  This version calls mpg123.% 2004-08-31 Fixed to read whole files correctly% 2004-09-08 Uses mp3info to get info about mp3 files too% 2004-09-18 Reports all mp3info fields in OPTS.fmt; handles MPG2LSF sizes%            + added MONO, DOWNSAMP flags, changed default behavior.% 2005-09-28 Fixed bug reading full-rate stereo as 1ch (thx bjoerns@vjk.dk)% 2006-09-17 Chop off initial 2257 sample delay (for 44.1 kHz mp3)%            so read-write loop doesn't get progressively delayed.%            You can suppress this with a 5th argument of 0.% 2007-02-04 Added support for FMT argument to match wavread%            Added automatic selection of binary etc. to allow it%            to work cross-platform without editing prior to%            submitting to Matlab File Exchange% 2007-07-23 Tweaks to 'size' mode so it exactly agrees with read data.% 2009-03-15 Added fixes so 'http://...' file URLs will work.% find our baseline directorypath = fileparts(which('mp3read'));% %%%%% Directory for temporary file (if needed)% % Try to read from environment, or use /tmp if it exists, or use CWDtmpdir = getenv('TMPDIR');if isempty(tmpdir) || exist(tmpdir,'file')==0  tmpdir = '/tmp';endif exist(tmpdir,'file')==0  tmpdir = '';end% ensure it exists%if length(tmpdir) > 0 && exist(tmpdir,'file')==0%  mkdir(tmpdir);%end%%%%%% Command to delete temporary file (if needed)rmcmd = 'rm';%%%%%% Location of the binaries - attempt to choose automatically%%%%%% (or edit to be hard-coded for your installation)ext = lower(computer);if ispc  ext = 'exe';  rmcmd = 'del';endmpg123 = fullfile(path,['mpg123.',ext]);mp3info = fullfile(path,['mp3info.',ext]);%%%%% Check for network modeif strcmp(lower(FILE(1:7)),'http://') == 1 ...      | strcmp(lower(FILE(1:6)),'ftp://')  % mp3info not available over network  OVERNET = 1;else  OVERNET = 0;end%%%%% Process input argumentsif nargin < 2  N = 0;end% Check for FMT spec (per wavread)FMT = 'double';if ischar(N)  FMT = lower(N);  N = 0;endif length(N) == 1  % Specified N was upper limit  N = [1 N];endif nargin < 3  forcemono = 0;else  % Check for 3rd arg as FMT  if ischar(MONO)    FMT = lower(MONO);    MONO = 0;  end  forcemono = (MONO ~= 0);endif nargin < 4  downsamp = 1;else  downsamp = DOWNSAMP;endif downsamp ~= 1 && downsamp ~= 2 && downsamp ~= 4  error('DOWNSAMP can only be 1, 2, or 4');endif nargin < 5  mpg123delay44kHz = 2257;  % empirical delay of lame/mpg123 loop  delay = round(mpg123delay44kHz/downsamp);else  delay = DELAY;endif strcmp(FMT,'native') == 0 && strcmp(FMT,'double') == 0 && ...      strcmp(FMT,'size') == 0  error(['FMT must be ''native'' or ''double'' (or ''size''), not ''',FMT,'''']);end%%%%%% ConstantsNBITS=16;%%%%% add extension if none (like wavread)[path,file,ext] = fileparts(FILE);if isempty(ext)  FILE = [FILE, '.mp3'];endif ~OVERNET  %%%%%% Probe file to find format, size, etc. using "mp3info" utility  cmd = ['"',mp3info, '" -r m -p "%Q %u %b %r %v * %C %e %E %L %O %o %p" "', FILE,'"'];  % Q = samprate, u = #frames, b = #badframes (needed to get right answer from %u)   % r = bitrate, v = mpeg version (1/2/2.5)  % C = Copyright, e = emph, E = CRC, L = layer, O = orig, o = mono, p = pad  w = mysystem(cmd);  % Break into numerical and ascii parts by finding the delimiter we put in  starpos = findstr(w,'*');  nums = str2num(w(1:(starpos - 2)));  strs = tokenize(w((starpos+2):end));  SR = nums(1);  nframes = nums(2);  nchans = 2 - strcmp(strs{6}, 'mono');  layer = length(strs{4});  bitrate = nums(4)*1000;  mpgv = nums(5);  % Figure samples per frame, after  % http://board.mp3-tech.org/view.php3?bn=agora_mp3techorg&key=1019510889  if layer == 1    smpspfrm = 384;  elseif SR < 32000 && layer ==3    smpspfrm = 576;    if mpgv == 1      error('SR < 32000 but mpeg version = 1');    end  else    smpspfrm = 1152;  end  OPTS.fmt.mpgBitrate = bitrate;  OPTS.fmt.mpgVersion = mpgv;  % fields from wavread's OPTS  OPTS.fmt.nAvgBytesPerSec = bitrate/8;  OPTS.fmt.nSamplesPerSec = SR;  OPTS.fmt.nChannels = nchans;  OPTS.fmt.nBlockAlign = smpspfrm/SR*bitrate/8;  OPTS.fmt.nBitsPerSample = NBITS;  OPTS.fmt.mpgNFrames = nframes;  OPTS.fmt.mpgCopyright = strs{1};  OPTS.fmt.mpgEmphasis = strs{2};  OPTS.fmt.mpgCRC = strs{3};  OPTS.fmt.mpgLayer = strs{4};  OPTS.fmt.mpgOriginal = strs{5};  OPTS.fmt.mpgChanmode = strs{6};  OPTS.fmt.mpgPad = strs{7};  OPTS.fmt.mpgSampsPerFrame = smpspfrm;else  % OVERNET mode  OPTS = [];  % guesses  smpspfrm = 1152;  SR = 44100;  nframes = 0;end  if SR == 16000 && downsamp == 4  error('mpg123 will not downsample 16 kHz files by 4 (only 2)');endif downsamp == 1  downsampstr = '';else  downsampstr = [' -',num2str(downsamp)];endFS = SR/downsamp;if forcemono == 1  nchans = 1;  chansstr = ' -m';else  chansstr = '';end% Size-reading versionif strcmp(FMT,'size') == 1   Y = [floor(smpspfrm*nframes/downsamp)-delay, nchans];else  % Temporary file to use  tmpfile = fullfile(tmpdir, ['tmp',num2str(round(1000*rand(1))),'.wav']);  skipx = 0;  skipblks = 0;  skipstr = '';  sttfrm = N(1)-1;  % chop off transcoding delay?  %sttfrm = sttfrm + delay;  % empirically measured  % no, we want to *decode* those samples, then drop them  % so delay gets added to skipx instead    if sttfrm > 0    skipblks = floor(sttfrm*downsamp/smpspfrm);    skipx = sttfrm - (skipblks*smpspfrm/downsamp);    skipstr = [' -k ', num2str(skipblks)];  end  skipx = skipx + delay;    lenstr = '';  endfrm = -1;  decblk = 0;  if length(N) > 1    endfrm = N(2);    if endfrm > sttfrm      decblk = ceil((endfrm+delay)*downsamp/smpspfrm) - skipblks + 10;         % we read 10 extra blks (+10) to cover the case where up to 10 bad       % blocks are included in the part we are trying to read (it happened)      lenstr = [' -n ', num2str(decblk)];      % This generates a spurious "Warn: requested..." if reading right       % to the last sample by index (or bad blks), but no matter.    end end  % Run the decode  cmd=['"',mpg123,'"', downsampstr, chansstr, skipstr, lenstr, ...       ' -q -w "', tmpfile,'"  "',FILE,'"'];  %w =   mysystem(cmd);  % Load the data  Y = wavread(tmpfile);%  % pad delay on to end, just in case%  Y = [Y; zeros(delay,size(Y,2))];%  % no, the saved file is just longer    if decblk > 0 && length(Y) < decblk*smpspfrm/downsamp    % This will happen if the selected block range includes >1 bad block    disp(['Warn: requested ', num2str(decblk*smpspfrm/downsamp),' frames, returned ',num2str(length(Y))]);  end    % Delete tmp file  mysystem([rmcmd,' "', tmpfile,'"']);    % debug%  disp(['sttfrm=',num2str(sttfrm),' endfrm=',num2str(endfrm),' skipx=',num2str(skipx),' delay=',num2str(delay),' len=',num2str(length(Y))]);    % Select the desired part  if skipx+endfrm-sttfrm > length(Y)      endfrm = length(Y)+sttfrm-skipx;  end    if endfrm > sttfrm    Y = Y(skipx+(1:(endfrm-sttfrm)),:);  elseif skipx > 0    Y = Y((skipx+1):end,:);  end    % Convert to int if format = 'native'  if strcmp(FMT,'native')    Y = int16((2^15)*Y);  endend%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%function w = mysystem(cmd)% Run system command; report error; strip all but last line[s,w] = system(cmd);if s ~= 0   error(['unable to execute ',cmd,' (',w,')']);end% Keep just final linew = w((1+max([0,findstr(w,10)])):end);% Debug%disp([cmd,' -> ','*',w,'*']);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%function a = tokenize(s,t)% Break space-separated string into cell array of strings.% Optional second arg gives alternate separator (default ' ')% 2004-09-18 dpwe@ee.columbia.eduif nargin < 2;  t = ' '; enda = [];p = 1;n = 1;l = length(s);nss = findstr([s(p:end),t],t);for ns = nss  % Skip initial spaces (separators)  if ns == p    p = p+1;  else    if p <= l      a{n} = s(p:(ns-1));      n = n+1;      p = ns+1;    end  endend    

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩在线观看一区二区 | 国产一区二区三区在线观看免费视频| 蜜臀国产一区二区三区在线播放| 国产精品一区二区三区网站| 欧美美女喷水视频| 国产精品成人免费| 韩国女主播成人在线| 在线免费av一区| 国产精品国产三级国产普通话99| 久久99国内精品| 欧美日韩免费在线视频| 亚洲激情自拍视频| 成人av网站大全| 国产喷白浆一区二区三区| 精品中文av资源站在线观看| 91精品国产高清一区二区三区| 亚洲精品亚洲人成人网在线播放| 国产69精品一区二区亚洲孕妇| 精品捆绑美女sm三区| 另类中文字幕网| 日韩一区二区三区四区五区六区| 亚洲国产日韩在线一区模特| 欧美亚洲高清一区| 亚洲综合激情网| 色综合色狠狠天天综合色| 亚洲欧美在线另类| 99久久777色| 亚洲日本中文字幕区| 色综合久久久久网| 亚洲国产日日夜夜| 欧美电影在线免费观看| 日韩av午夜在线观看| 日韩一卡二卡三卡国产欧美| 日产国产高清一区二区三区| 欧美大片顶级少妇| 麻豆国产精品一区二区三区 | 欧美猛男gaygay网站| 亚洲国产精品一区二区久久恐怖片| 欧美一区二区三区四区高清| 水野朝阳av一区二区三区| 欧美一三区三区四区免费在线看 | 久久精品一区二区三区四区| 久久精品久久99精品久久| 日韩情涩欧美日韩视频| 精品一区二区成人精品| 欧美激情在线看| 色8久久精品久久久久久蜜 | 中文字幕第一页久久| 丰满少妇久久久久久久| 中文字幕在线观看不卡| 欧美日韩一级二级三级| 国精产品一区一区三区mba视频| 国产午夜精品一区二区| 91麻豆精东视频| 首页国产欧美日韩丝袜| 国产拍揄自揄精品视频麻豆| 色狠狠综合天天综合综合| 日韩**一区毛片| 久久久91精品国产一区二区精品| 色综合天天综合网天天狠天天| 午夜精品爽啪视频| 国产欧美一区二区精品婷婷| 在线视频你懂得一区| 美国十次了思思久久精品导航| 国产精品色眯眯| 欧美人体做爰大胆视频| 国产麻豆一精品一av一免费| 亚洲精品视频观看| 国产亚洲视频系列| 欧美视频在线一区二区三区 | 欧美老肥妇做.爰bbww视频| 久久国产福利国产秒拍| 综合激情成人伊人| 日韩一区二区三区在线| 色999日韩国产欧美一区二区| 久久不见久久见免费视频1| 亚洲三级在线免费观看| 精品国产一区二区三区久久久蜜月| 91亚洲精华国产精华精华液| 另类调教123区| 亚洲国产另类av| 亚洲欧洲日产国产综合网| 精品国产一区二区亚洲人成毛片| 91国模大尺度私拍在线视频| 国产成人鲁色资源国产91色综| 日韩精品国产精品| 亚洲在线免费播放| 中文字幕一区在线| 久久综合色天天久久综合图片| 欧美老年两性高潮| 日本久久一区二区| 99视频在线精品| 国产精品香蕉一区二区三区| 青青草97国产精品免费观看| 亚洲国产日韩一级| 亚洲久草在线视频| 亚洲欧美日韩电影| 中文字幕综合网| 国产精品天干天干在线综合| 精品久久人人做人人爰| 91精品综合久久久久久| 欧美日韩一区不卡| 欧美在线你懂得| 在线欧美日韩国产| 欧美在线观看视频一区二区三区| 91亚洲精华国产精华精华液| a级精品国产片在线观看| 成人av集中营| 99精品视频在线播放观看| av高清不卡在线| 91麻豆免费视频| 色哟哟国产精品| 91久久久免费一区二区| 日本韩国欧美国产| 91黄色免费看| 91超碰这里只有精品国产| 5566中文字幕一区二区电影| 91精品国产一区二区三区蜜臀| 51久久夜色精品国产麻豆| 制服.丝袜.亚洲.另类.中文| 91麻豆精品国产91久久久久久久久| 717成人午夜免费福利电影| 日韩一区二区三免费高清| 日韩欧美国产一区在线观看| 精品福利视频一区二区三区| 久久久久久久久久美女| 国产精品久久久久久久久免费樱桃 | 国产盗摄精品一区二区三区在线| 日韩av中文字幕一区二区| 日日夜夜精品视频天天综合网| 免播放器亚洲一区| 久久 天天综合| 成人av网站大全| 欧美日韩国产综合视频在线观看 | 国产精品色呦呦| 国产精品久久久久影院老司| 一区二区三区精品在线| 日本视频一区二区| 国产激情视频一区二区在线观看 | 亚洲成人福利片| 美女mm1313爽爽久久久蜜臀| 国产一区二区三区四| 97久久精品人人做人人爽50路| 欧美午夜在线观看| 精品国产自在久精品国产| 日韩美女啊v在线免费观看| 亚洲地区一二三色| 高清不卡一二三区| 欧美日本一区二区三区| 国产欧美视频一区二区三区| 亚洲国产成人精品视频| 国内精品视频一区二区三区八戒| 91精品福利视频| 久久久精品国产免大香伊| 亚洲福中文字幕伊人影院| 国产高清久久久| 欧美日本在线一区| 最新久久zyz资源站| 麻豆精品久久久| 色女孩综合影院| 久久精品亚洲精品国产欧美kt∨| 亚洲乱码国产乱码精品精98午夜 | 国产三区在线成人av| 樱桃视频在线观看一区| 国产69精品久久99不卡| 91精品国产综合久久婷婷香蕉| 国产精品理论片| 国内久久婷婷综合| 在线播放中文一区| 亚洲一区在线免费观看| 成人高清视频免费观看| 精品国产髙清在线看国产毛片| 亚洲国产一区二区视频| 99久久精品免费看国产免费软件| 精品国精品国产| 麻豆精品一区二区三区| 51精品视频一区二区三区| 亚洲资源在线观看| 91视频com| 中文字幕+乱码+中文字幕一区| 麻豆国产精品一区二区三区 | 国产欧美精品一区二区三区四区 | 中文字幕国产精品一区二区| 免费观看日韩电影| 欧美色国产精品| 亚洲免费看黄网站| 91麻豆精东视频| 亚洲乱码国产乱码精品精98午夜| 成人h精品动漫一区二区三区| 欧美国产一区视频在线观看| 国产一区二区三区综合| 精品久久人人做人人爽| 精品制服美女久久| 久久免费电影网| 国产精品一卡二卡| 国产欧美一区二区精品婷婷| 国产精品正在播放| 国产欧美精品在线观看| 不卡一区在线观看| 亚洲精品乱码久久久久久久久|