audioreadTL

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Video/Audio/PDF
Introduced first in SolidGeometry 4.9, Creation date: 2020-03-27, Last change: 2025-09-14

similar to audioread but with sound output after readin

Description

similar to audioread but allows interactive use and returns information during plays

See Also: soundTL , audiorecorderTL , audiotrim , audiovocoder , audiowriteTL

Example Illustration

 missing image of audioreadTL(AName,nFS)

Syntax

[y,FS]=audioreadTL([AName,nFS])

Input Parameter

AName: Filename; User interaction required if empty
nFS: desired sample frequency

Output Parameter

y: Signal
FS: Sample Frequency

Examples


audioreadTL('/Users/lueth/Desktop/IMG_9776.mp4');
audioreadTL;




Copyright 2020-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This function, audioreadTL, is designed to read audio files and optionally play them back, providing interactive use and feedback on the sample frequency. It is similar to the standard audioread function but includes additional features for user interaction and sound output.

Input Parameters

Output Results

Algorithm Steps

  1. Retrieve the filename (AName) and desired sample frequency (nFS) from the input parameters using the getfuncparams function.
  2. If AName is empty, prompt the user to select a file using tryuigetfile, which filters for *.mp4, *.mp3, and *.wav formats.
  3. If no filename was initially provided, output a debug message with the selected filename.
  4. Read the audio file using audioread, obtaining the audio data (y) and its sample frequency (FS).
  5. If a desired sample frequency (nFS) is specified, resample the audio data to this frequency using audioresample.
  6. If no output arguments are specified, print the sample frequency in kHz and play the audio using soundTL.
Algorithm explaination created using ChatGPT on 2025-08-19 06:50. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21