J'ai mis un fichier son stocké dans la base de données en tant que Byte[]
. Maintenant, je veux lire ce fichier son dans mon programme WPF. Comment puis-je faire ceci?Lire un fichier son dans l'application WPF
2
A
Répondre
2
Vous devez faire quelque chose comme ce qui suit:
private void PlaySoundFromBytes(byte[] rawSoundBytes)
{
Stream rawStream = new MemoryStream(rawSoundBytes);
var player = new SoundPlayer(rawStream);
player.Play();
}
2
Peut-être que ce lien est pertinent à votre situation:
http://vbcity.com/blogs/xtab/archive/2009/06/29/how-to-play-sounds-and-music-in-wpf.aspx
Questions connexes
- 1. Comment puis-je lire un fichier son OGG dans mon application WPF de bureau?
- 2. Comment lire un petit fichier son en continu dans Silverlight?
- 3. Comment lire un fichier son sous un navigateur Android
- 4. comment lire un fichier son en utilisant FMOD sdk?
- 5. Comment lire un fichier flv dans WPF Media element
- 6. DirectSound peut-il lire un fichier son binaire brut?
- 7. comment lire le fichier son MID dans l'iphone?
- 8. Télécharger le fichier dans coldfusion et lire son contenu
- 9. comment lire le fichier son m4a dans systemsoundid?
- 10. Comment lire un son Windows standard?
- 11. Comment lire un son de notification Android
- 12. Comment lire un fichier wav dans Delphi?
- 13. Lire le son avec un retard
- 14. Comment lire un fichier WAV dans ActionScript?
- 15. Facile - Lire un fichier dans un tableau
- 16. Lire un fichier CSV dans un tableau
- 17. TinyXML ne peut pas lire son propre fichier
- 18. Comment lire une vidéo avec un son externe dans Silverlight?
- 19. comment lire un fichier
- 20. Son/Silence dans un fichier wav
- 21. Javascript lire un fichier
- 22. Lire un fichier local
- 23. Lire un fichier JDF
- 24. DFC lire un fichier
- 25. Impossible de lire un son enregistré sur l'appareil
- 26. Comment lire un fichier et écrire dans un fichier texte?
- 27. Comment lire un paramètre passé dans un UserControl WPF?
- 28. Comment lire un fichier FLV dans Ext.Window?
- 29. Lire dans un fichier avec html droit
- 30. Lire des fichiers dans un fichier JAR
Merci you.By la manière, à quelle heure est-il maintenant ? – Bennet
21h30, heure de Saint-Louis. ??? – JoshVarga
I en Asia.So ... – Bennet