Skip to content Skip to navigation

OpenStax-CNX

You are here: Home » Content » sam_GrabAudioDynamic.vi

Navigation

Lenses

What is a lens?

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

This content is ...

In these lenses

  • LabVIEW Digital Communications display tagshide tags

    This module is included inLens: Analog / Digital Communications with National Instruments LabVIEW
    By: Sam ShearmanAs a part of collections: "SubVI Specifications for "Communication Systems Projects with LabVIEW"", "Communication Systems Projects with LabVIEW"

    Comments:

    ""Communication Systems Projects with LabVIEW" features ten projects that draw upon a library of over 40 subVIs constructed as part of the project activities. Each module in this manual completely […]"

    "Starting point collection that gathers all modules from this course"

    Click the "LabVIEW Digital Communications" link to see all content selected in this lens.

    Click the tag icon tag icon to display tags associated with this content.

Recently Viewed

This feature requires Javascript to be enabled.

Tags

(What is a tag?)

These tags come from the endorsement, affiliation, and other lenses that include this content.
 

sam_GrabAudioDynamic.vi

Module by: Ed Doering. E-mail the authorEdited By: Erik Luther, Sam Shearman

Summary: Build a LabVIEW subVI to wait for audio level to exceed a user-defined threshold, and then record audio until the audio level drops below the threshold again.

Table 1
LabVIEWtop.png This module refers to LabVIEW, a software development environment that features a graphical programming language. Please see the LabVIEW QuickStart Guide module for tutorials and documentation that will help you:
• Apply LabVIEW to Audio Signal Processing
• Get started with LabVIEW
• Obtain a fully-functional evaluation edition of LabVIEW

Note:

Visit LabVIEW Setup to learn how to adjust your own LabVIEW environment to match the settings used by the LabVIEW screencast video(s) in this module. Click the "Fullscreen" button at the lower right corner of the video player if the video does not fit properly within your browser window.

LabVIEW SubVI: sam_GrabAudioDynamic.vi

  • Description: Wait for audio level to exceed a user-defined threshold, and then record audio until the audio level drops below the threshold again or recording duration reaches a maximum value. This subVI depends on sam_ListenForAudio.vi. In addition, sam_GrabAudio.vi should be constructed before attempting the dynamic-stop version of this module.
  • Category: Speaker-air-microphone (SAM) channel ("sam" prefix)

Inputs (Controls)

  1. frame length [s] (0.1) -- DBL
  2. max duration [s] (10) -- DBL
  3. threshold level (0.1) -- DBL
  4. fs [Hz] (22050) -- DBL
  5. error in (no error) -- error cluster

Parentheses ( ) indicate default value; square brackets [ ] designate units.

Outputs (Indicators)

  1. signal out -- waveform
  2. error out -- error cluster

Required Behavior

  • Use sam_ListenForAudio.vi to continually acquire audio samples in blocks (frames) of size frame length. Once "sam_ListenForAudio" completes execution (i.e., when the audio level exceeds threshold level), record and store audio frames until either of two possible conditions occurs: (1) maximum audio level within a frame is lower than the threshold level, or (2) total number of stored audio frames would exceed max duration.
  • The audio output of sam_ListenForAudio.vi serves as the beginning of the audio signal signal out. The last audio frame containing silence must be excluded from signal out.
  • The sound-card must be cleaned up using "Graphics and Sound | Sound | Input | Sound Input Clear" once the audio has been recorded.

Free LabVIEW Code

LabVIEW.png This subVI is rather complex to build and debug, so feel free to download the finished subVI sam_GrabAudioDynamic.vi.

You may find it helpful to test the subVI with the demo sam_GrabAudioDynamic_demo.vi.

Content actions

Download module as:

Add module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks