Skip to content

How to convert a SizedSample to a f32? #755

Closed

Description

@tuzz

I am trying to upgrade my audio_mixer crate to the latest version of cpal. It currently depends on cpal 0.13.4.

I believe I have to change Sample to SizedSample but I can't find a way to convert a SizedSample to a plain f32.

This is the line I'm struggling to get to compile:
https://github.com/tuzz/audio_mixer/blob/f47de2157d249d864a35a50fdd4f3fb562c50576/src/audio_recorder.rs#L34

Is there a conversion trait I need to include?

Thanks

Activity

  1. est31 commented on Feb 24, 2023

    @est31
    Member

    In theory to_sample should work.

  2. locked and limited conversation to collaborators on Aug 17, 2026
  3. converted this issue into a discussion #1319 on Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions