Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9143087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:56:12+00:00 2026-06-17T09:56:12+00:00

I am trying to read data from a .wav file from position X to

  • 0

I am trying to read data from a .wav file from position X to Y specified by user. The code compiles file but for some reason the wavread function is not reading from the specified positions. It returns zero in the y vector. If I don’t do like [y,fs]=wavread('Kalimba.wav', [StartingTime EndingTime]); , then the code works fine and returns non zero data.

Why is this happening and how can I solve this?

Here is the code:

 function PlayFromXtoY(StartingTime,EndingTime)

% converting the startingTime and EndingTime to minutes

if StartingTime == 0
    disp('Zero')
    StartingTime=1;

elseif StartingTime < 1
         disp('Start <1')
         StartingTime=StartingTime*10;

    elseif StartingTime >= 1
            disp('Start >=1');
            StartingTime=StartingTime*60;
end

if EndingTime < 1
    disp('End <1');
    EndingTime=EndingTime*10;

elseif EndingTime >= 1
        disp('End >=1');
        EndingTime=EndingTime*60;
end

[y,fs]=wavread('Kalimba.wav', [StartingTime EndingTime]); % returning 0 in y for some reason

wavplay(y,fs);

Regards

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:56:13+00:00Added an answer on June 17, 2026 at 9:56 am

    Your first problem is that you perform very strange modifications of your start time and stop time before you invoke wavread. It could help to disp those times just before the call and if hese really make sense.

    Most importantly, however, you consider these limits as times while to wavread they are not. According to he documentation, the limits you pass are supposed to be sample numbers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was trying to read data from some huge file and write them back,
Im trying to read some data from a binary file into a buffer allocated
I'm trying to read data from csv file, but instead of e.g. 001000 I
I am trying to read data from properties file.I have specified the path in
I am trying to read some data from my XML file Names/Name/trckid 1) For
I'm trying to read data from an xml file and display it in a
I am trying to read data from a file stream as shown below: fileStream.Read(byteArray,
I'm trying to read data from a binary file and put it into a
I am trying to read data from excel file in asp.net. I have added
I'm trying to read the EXIF data from an image, selected by a user.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.