Byte arrary to double array?

I use this code to get a byte arrary from a wav file and now I want to convert these bytes to doubles so i can get the data of the file :

def fileToByteArray(name: String) = {
      val path = Paths.get(name)
      try Files.readAllBytes(path)
      catch {
        case e: IOException =>

It’s not really a simple case of transforming a byte to a double in this case.

You would need to understand the file format first and create a parser for it WAV - Waveform Audio File Format

alternatively find a library that can do it for you. A quick google search yields GitHub - mziccard/scala-audio-file: Minimal Scala library to process audio files but there are probably others.

okay thanks!!