Hi all. I have correctly set the audio module with ID3 and I'm uploading MP3 and all it's fine. But, when I upload a WAV file, I get this error: "This file is not compatible with the Flash audio player. Flash can only play MP3 files with a sample rate of 11, 22 or 44KHz.". The flash player appears but it does not play the file, it keeps eternally "buffering". The WAV is correctly recognized by the audio module (for example, I see # Length: 0:02 minutes (87.61 KB) # Format: RIFF Mono 22kHz 352Kbps (CBR). I have correctly set the 1pixelout player as WAV player in settings (and I have also tested the 3 included players for WAV files with no luck).

Comments

we241’s picture

Title: WAV Flash Player does not work » Having same problem

Similar problem here. I do not get an error message but when I upload a WAV file a "Click to play" link appears instead of the player. MP3 uploads work perfectly. In the audio database table fileformat for the uploaded file is RIFF. If I manually change RIFF to WAV the player appears but buffers and does not play the file.

webchick’s picture

Title: Having same problem » WAV Flash Player does not work

Restoring title. Please don't change the title of the issue unless you intend to clarify it.

zirafa’s picture

I've never seen a .wav file stream through a flash player - my understanding is that only mp3 audio streaming is supported. While importing .wav files directly into Flash is possible, that has to occur before the flash player is compiled to swf. If anybody has a working example or link to a flash player that supports wav streaming, please post them here.

sgriffin’s picture

While some "WAVS" are nothing more than renamed mp3s... I think perhaps, its a mistake to support the wav extension in this module.
However you could use this module to provide raw links to wav files, to manage downloads.. Perhaps some better documentation is needed.
What about ogg? Same thing probably.

manimal’s picture

I have the same issue as the original post. however, it even happens with mp3's. I've only gotten this on 5.2. 5.1 worked, uploading the same mp3 file for both versions.

I can create the audio node, I get the error, and when I check out the node after its created, there's no player... all I get are the ID3 tags displayed..

gracearoha’s picture

I am using Drupal 5.2 and also cannot get any of the players (mps or wav) to show up.
The node shows up fine, but instead of the player, i have only the "click to play" link with the option to download the file.

meecect’s picture

I made a contribution that may help people who want to upload wavs:

http://drupal.org/node/191701#comment-635608

drewish’s picture

i'm marking http://drupal.org/node/191701 as a duplicate of this.

meecect, please move your patch over here.

meecect’s picture

copied from duplicate thread:

well, I've been looking at the code, and I think the 'wav' support is very confusing. I guess it will only accept wav files that are actually mp3 files?

So I modified it a bit to work the way I _think_ it should. I added a player .inc file called 'embedded.inc' . This player can be registered to handle wav files and 'riff' files ( what getid3 recognizes wav files as) and will put the mediaplayer control on the pages with wav's, much akin to how the 1pixelout player shows up for mp3's.

Another change you may need to make is on the getid3 settings page, uncheck the default 'write to file' columns. Otherwise, the module will attempt to write id3 tags to the file _regardless of type_. That's why people ini other threads were compaining about wav files unable to be downloaded and played after uploading, because the file is corrupt after writing id3 tags to a perfectly good wav.

A better solution would be to change the audio_getid3 module to only write tags to files that actually can have tags. I may write a patch to just that, actually.

Another thing to do would be to support macs somehow, but I haven't gotten that to work yet for embedded wavs. Btw, this will probably work for wma's as well with a small modification.

embedded.inc:

<?php

function audio_embedded_audio_player() {
  $items['embedded'] = array(
    'module'      => 'audio',
    'title'       => t('Embedded'),
    'description' => t('Tries to use embedded audio players'),
    'url'         => t(''),
    'preview'     => '',
    'formats'     => array('wav', 'mp3', 'riff'),
    'theme_node'  => 'audio_embedded_node_player',
  );
  return $items;
}

function theme_audio_embedded_node_player($node, $options = array()) {
  // make sure it's compatible with the flash player
  //if (!audio_is_flash_playable($node)) {
  //  return NULL;
  //}

  $source = check_url($node->url_play);
  //$url = base_path() . drupal_get_path('module', 'audio') .'/players/1pixelout.swf';
  $flashvars = audio_query_string_encode($options);

$output = <<<EOT
 <!-- begin embedded WindowsMedia file... -->
      <OBJECT id='mediaPlayer' width="320" height="45" 
      classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' 
      codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'
      standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'>
      <param name='fileName' value="$source">
      <param name='animationatStart' value='true'>
      <param name='transparentatStart' value='true'>
      <param name='autoStart' value="false">
      <param name='showControls' value="true">
      <param name='loop' value="false">
      <EMBED type='application/x-mplayer2'
        pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'
        id='mediaPlayer' name='mediaPlayer' displaysize='4' autosize='-1' 
        bgcolor='darkblue' showcontrols="true" showtracker='-1' 
        showdisplay='0' showstatusbar='0' videoborder3d='-1' width="320" height="45"
        src="$source" autostart="false" designtimesp='5311' loop="false">
      </EMBED>
      </OBJECT>
      <!-- ...end embedded WindowsMedia file -->
    <!-- begin link to launch external media player...
        <a href="http://servername/path/to/media.file" style='font-size: 85%;' target='_blank'>Launch in external player</a>
     ...end link to launch external media player... -->

EOT;

  return $output;
}

drupalhooked’s picture

Thanks so much Meecect,

I had the same problem and the problem could only be resolved only due to the code provided by you.

thanks once again!

God bless!!

datacompboy’s picture

you can find stream flash-based player for .wav and .au files encoded by pcm or g711 in mine blog: http://blog.datacompboy.ru

support for other codecs can be added relatively simple.

hattomee’s picture

Thank you very much for the helpful code meecect. Can someone help us with mac support for wav files?

unc0nnected’s picture

This worked for me.. thank yuo so much for this code, what a life saver! I would think this coudl be marked as fixed as there's no way to get flash to stream .wav files from what I understand