Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. how to change sound to byte and byte to sound?

how to change sound to byte and byte to sound?

Scheduled Pinned Locked Moved C#
questiondata-structurestutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bahman2000b
    wrote on last edited by
    #1

    I've designed a udp connection using socket and threading. I want to know how I can change sound to an array of byte and change an array of byte to sound. So how can I set received sound to speaker and give output sound from its device like microphone? What should I do? Thanks a lot for your answers. Bahman

    L 1 Reply Last reply
    0
    • B bahman2000b

      I've designed a udp connection using socket and threading. I want to know how I can change sound to an array of byte and change an array of byte to sound. So how can I set received sound to speaker and give output sound from its device like microphone? What should I do? Thanks a lot for your answers. Bahman

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Hi, I have a partial answer to your question: store the sound data in a byte array, pin it in memory, and call the unmanaged function [DllImport("Winmm.dll", CallingConvention=CallingConvention.Cdecl)] static extern int sndPlaySound(IntPtr buffer, int dwFlags); with flag value = 4 (= SND_MEMORY) More on this in http://www.bobpowell.net/playsnd.htm[^] Dont know about capturing sounds though.

      Luc Pattyn

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups