フィルターのクリア

How to play a map3 file and extract it from an Excel spreadsheet. If not, how can it be done?

2 ビュー (過去 30 日間)
Enrico
Enrico 2023 年 3 月 15 日
編集済み: Enrico 2023 年 3 月 17 日
if strcmpi(UserSelection,'randomly')
Songlength = length(MusicDatabase);
Pickrand = randi([2,Songlength], 1,1);
fprintf("\t \n");
fprintf(' The information on the song selected by the software is the following: \n');
InfoSongName = MusicDatabase{Pickrand, 1};
fprintf( ' The song name is %s. \n', InfoSongName);
InfoSongSinger = MusicDatabase{Pickrand, 2};
fprintf(' The song singer is %s. \n', InfoSongSinger);
InfoSongTime = MusicDatabase{Pickrand, 3};
fprintf(" The song time is %s. \n", InfoSongTime);
InfoSongGenre = MusicDatabase{Pickrand, 4};
fprintf(' The song genre is %s. \n', InfoSongGenre);
InfoSongLanguage = MusicDatabase{Pickrand, 5};
fprintf(" The song langauge is %s. \n",InfoSongLanguage);
fprintf("\t \n");
UserRandSong = input(' Select Yes if desired to play song; if not select No. ','s');
while strcmpi(UserRandSong, 'Yes') ~=1 && strcmpi(UserRandSong, 'No') ~=1
fprintf(' Select Yes or No NERD!!! \n');
UserRandSong = input(' Select Yes if desired to play song; if not select No. ','s');
end
% My idea is the following since the variable with song equals a row in the Excel spreadsheet,
% column 7 of the same Excel spreadsheet is a link to the mp3 file. But I don't know how to
% implement it or if it works.
  7 件のコメント
Enrico
Enrico 2023 年 3 月 17 日
The song is stored in the variable Pickrand. Yes, "MusicDatabse" is the imported Excel file. I mean MP3 (apologies for my spelling). Column 7 of the excel file "MusicDatabase" has the link of the MP3 files.
Enrico
Enrico 2023 年 3 月 17 日
編集済み: Enrico 2023 年 3 月 17 日
[VariableSong, Variable] = audioread(MusicDatabase{SongPlay, 6});
Song = audioplayer(VariableSong, Variable);
PlaySong = input(' Will you like to play the song Yes or No ','s');
if strcmpi(PlaySong ,'Yes')
soundsc(VariableSong, Variable);
end
% This is was I thinking but it does not work, in the columns 6 are the
% links of the songs.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeAudio and Video Data についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by