私は.wav音楽ファイルを持っています。 SoundEffect.Play()を使用して再生しようとしたとき。サウンドウィンドウを再生するとノイズが発生する電話7エミュレータ
mus1.Play();私は音楽よりもノイズを得ています。 PCの音楽プレーヤーでも同じように再生されます。 この問題を解決するにはどうすればよいですか?
Windows Phone 7でもうまく再生されるようにするにはどうすればいいですか?
私は.wav音楽ファイルを持っています。 SoundEffect.Play()を使用して再生しようとしたとき。サウンドウィンドウを再生するとノイズが発生する電話7エミュレータ
mus1.Play();私は音楽よりもノイズを得ています。 PCの音楽プレーヤーでも同じように再生されます。 この問題を解決するにはどうすればよいですか?
Windows Phone 7でもうまく再生されるようにするにはどうすればいいですか?
を試してみてください。なぜこれを.wavに変換しようとしないのですか(これは既に.wavに入っていることがわかります)。これによって未知のデータが削除される可能性があります。
Audacity(http://audacity.sourceforge.net/)は無料で、これを行います。 .wavファイルをドラッグしてファイル→エクスポートをクリックしてください。
古いポストを再点火して申し訳ありませんが、同じことが起こっていますが、Audacityを使って.WAVに簡単に変更しても問題は解決しません。 http://stackoverflow.com/questions/13157992/audio-distored-and-incomprehensible-using-windows-phone-mediaelement(実際のデバイスではボーカルオーディオの代わりに歪みが発生する) – GONeale
次のようにあなたができることのように
MainPage.xaml.cs
namespace MediaSample
{
public partial class MainPage : PhoneApplicationPage
{
// Constructor
public MainPage()
{
InitializeComponent();
progress.DataContext = this;
this.Loaded += new System.Windows.RoutedEventHandler(MainPage_Loaded);
mediaplayer.BufferingProgressChanged += new System.Windows.RoutedEventHandler(mediaplayer_BufferingProgressChanged);
mediaplayer.CurrentStateChanged += new RoutedEventHandler(mediaplayer_CurrentStateChanged);
}
public double Duration { get; set; }
void mediaplayer_CurrentStateChanged(object sender, RoutedEventArgs e)
{
if (mediaplayer.CurrentState == MediaElementState.Playing)
{
Duration = mediaplayer.NaturalDuration.TimeSpan.TotalSeconds;
ThreadPool.QueueUserWorkItem(o =>
{
while (true)
{
Dispatcher.BeginInvoke(new Action(() => Progress = mediaplayer.Position.TotalSeconds * 100/Duration));
Thread.Sleep(0);
}
});
}
}
void mediaplayer_BufferingProgressChanged(object sender, System.Windows.RoutedEventArgs e)
{
MediaElement mediaplayer = sender as MediaElement;
if (mediaplayer.BufferingProgress == 1)
Debug.WriteLine(mediaplayer.NaturalDuration);
}
void MainPage_Loaded(object sender, System.Windows.RoutedEventArgs e)
{
mediaplayer.Source = new Uri("/Oru nalum..mp3", UriKind.Relative);
mediaplayer.Play();
}
public double Progress
{
get { return (double)GetValue(ProgressProperty); }
set { SetValue(ProgressProperty, value); }
}
// Using a DependencyProperty as the backing store for Progress. This enables animation, styling, binding, etc...
public static readonly DependencyProperty ProgressProperty =
DependencyProperty.Register("Progress", typeof(double), typeof(PhoneApplicationPage), new PropertyMetadata(0.0));
}
}
MainPage.xamlを
<phone:PhoneApplicationPage
x:Class="MediaSample.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True">
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
<TextBlock x:Name="ApplicationTitle" Text="Media Application" Style="{StaticResource PhoneTextNormalStyle}"/>
</StackPanel>
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<MediaElement x:Name="mediaplayer"/>
<ProgressBar Height="40" x:Name="progress" Value="{Binding Path=Progress}"/>
</Grid>
</Grid>
</phone:PhoneApplicationPage>
は、
をMP3ファイルを追加し、次のコードを試してみてください.wavファイルを追加します。働く良い。上記のテスト済みコード。 ありがとうございます。
SoundEffectクラスを使用するのではなく、MeadiaElementを使用します。 WP7は理解していない.wavファイルのコンテンツがありますようにですね、この1 MediaElement
お試しいただいた内容をお知らせください。 – abhinav
Francly、これはエミュレータでの問題と思われます...あなたのアプリをテストして問題の内容を確認できる人はいませんか?あなたが好きなのであれば、インターネット上でサンプルXAPを投稿することができます。私または他の開発者は、問題がフィジカルデバイスで持続するかどうかをテストして確認するのに役立ちます。 –