Changeset 84ae579e4f14328f28d90b06b768e4924b7b5a4b

Show
Ignore:
Timestamp:
12/09/02 01:52:42 (6 years ago)
Author:
Boris Dorès <babal@videolan.org>
git-committer:
Boris Dorès <babal@videolan.org> 1039395162 +0000
git-parent:

[2397666ac33531200664b053ea2dd993a12424d4]

git-author:
Boris Dorès <babal@videolan.org> 1039395162 +0000
Message:

- new headphone channel mixer with virtual spatialization effect : This

effect should give you the feeling that you stands in a real room with
a complete 5.1 speaker set when using only a headphone, providing a
more realistic sound experience. It should also be more comfortable
and less tiring when listening to music for long periods of time.It
works with any source format from mono to 5.1.

-> please try it and feel free to give me some feedback. Some

improvements are already planned (adding echo, more configuration
options, ...).

NB: whereas the filter itself is in a (very first) stable version, the

way it is integrated to the filter chain is only a _temporary_ hack
since it's the audio ouput core (input.c actually) which is directly
responsible for it. Integrating it in a more suitable way will
probably require some work on the way the filters are selected as
well as on the configuration level, but I'm working on it :)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • AUTHORS

    r6d14297 r84ae579  
    129129D: Win32 network input 
    130130D: Win32 interface 
     131D: Headphone channel mixer 
    131132S: France 
    132133 
  • ChangeLog

    rfc6ea05 r84ae579  
    22Not released yet 
    33 
     4  * ./modules/audio_filter/channel_mixer/headphone.x: new headphone channel 
     5    mixer with virtual spatialization effect 
     6  * ./modules/gui/win32/preferences.*: redesigned preference dialog box 
    47  * ./modules/audio_filter/resampler/linear.c: new audio resampler based on 
    58    linear interpolation 
  • configure.ac.in

    rbb57136 r84ae579  
    689689PLUGINS="${PLUGINS} float32tos16 float32tos8 float32tou16 float32tou8 a52tospdif fixed32tofloat32 fixed32tos16 s16tofloat32 s16tofloat32swab s8tofloat32 u8tofixed32 u8tofloat32" 
    690690PLUGINS="${PLUGINS} trivial_resampler ugly_resampler linear_resampler" 
    691 PLUGINS="${PLUGINS} trivial_channel_mixer
     691PLUGINS="${PLUGINS} trivial_channel_mixer headphone_channel_mixer
    692692PLUGINS="${PLUGINS} trivial_mixer spdif_mixer float32_mixer" 
    693693PLUGINS="${PLUGINS} aout_file" 
  • modules/LIST

    re9e8b06 r84ae579  
    11List of vlc plugins 
    2 $Id: LIST,v 1.5 2002/11/21 21:37:46 gbazin Exp $ 
     2$Id: LIST,v 1.6 2002/12/09 00:52:42 babal Exp $ 
    33 
    44 * a52_system: input module for A52 decapsulation. 
     
    6666 
    6767 * gtk: interface using the Gtk+ widget set. 
     68 
     69 * headphone: headphone channel mixer with virtual spatialization effect. 
    6870 
    6971 * idct: inverse DCT module, used by the video decoder. 
  • modules/audio_filter/channel_mixer/Modules.am

    r8641281 r84ae579  
    11SOURCES_trivial_channel_mixer = modules/audio_filter/channel_mixer/trivial.c 
     2SOURCES_headphone_channel_mixer = modules/audio_filter/channel_mixer/headphone.c 
  • src/audio_output/input.c

    r1b7ce26 r84ae579  
    33 ***************************************************************************** 
    44 * Copyright (C) 2002 VideoLAN 
    5  * $Id: input.c,v 1.26 2002/12/06 10:10:39 sam Exp $ 
     5 * $Id: input.c,v 1.27 2002/12/09 00:52:42 babal Exp $ 
    66 * 
    77 * Authors: Christophe Massiot <massiot@via.ecp.fr> 
     
    4242int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input ) 
    4343{ 
    44     audio_sample_format_t intermediate_format; 
     44    audio_sample_format_t intermediate_format, headphone_intermediate_format; 
     45    aout_filter_t * p_headphone_filter; 
    4546 
    4647    aout_FormatPrint( p_aout, "input", &p_input->input ); 
     
    5354    memcpy( &intermediate_format, &p_aout->mixer.mixer, 
    5455            sizeof(audio_sample_format_t) ); 
     56    memcpy( &headphone_intermediate_format, &p_aout->mixer.mixer, 
     57            sizeof(audio_sample_format_t) ); 
     58    if ( config_GetInt( p_aout , "headphone" ) ) 
     59    { 
     60        headphone_intermediate_format.i_physical_channels = p_input->input.i_physical_channels; 
     61        headphone_intermediate_format.i_original_channels = p_input->input.i_original_channels; 
     62        headphone_intermediate_format.i_bytes_per_frame = 
     63                headphone_intermediate_format.i_bytes_per_frame 
     64                * aout_FormatNbChannels( &headphone_intermediate_format ) 
     65                / aout_FormatNbChannels( &intermediate_format ); 
     66    } 
     67 
    5568    intermediate_format.i_rate = p_input->input.i_rate; 
     69    headphone_intermediate_format.i_rate = p_input->input.i_rate; 
    5670    if ( aout_FiltersCreatePipeline( p_aout, p_input->pp_filters, 
    5771                                     &p_input->i_nb_filters, &p_input->input, 
    58                                      &intermediate_format ) < 0 ) 
     72                                     &headphone_intermediate_format ) < 0 ) 
    5973    { 
    6074        msg_Err( p_aout, "couldn't set an input pipeline" ); 
     
    6478 
    6579        return -1; 
     80    } 
     81 
     82    if ( config_GetInt( p_aout , "headphone" ) ) 
     83    { 
     84        /* create a vlc object */ 
     85        p_headphone_filter = vlc_object_create( p_aout 
     86                , sizeof(aout_filter_t) ); 
     87        if ( p_headphone_filter == NULL ) 
     88        { 
     89            msg_Err( p_aout, "couldn't open the headphone virtual spatialization module" ); 
     90            aout_FifoDestroy( p_aout, &p_input->fifo ); 
     91            p_input->b_error = 1; 
     92            return -1; 
     93        } 
     94        vlc_object_attach( p_headphone_filter, p_aout ); 
     95 
     96        /* find the headphone filter */ 
     97        memcpy( &p_headphone_filter->input, &headphone_intermediate_format 
     98                , sizeof(audio_sample_format_t) ); 
     99        memcpy( &p_headphone_filter->output, &intermediate_format 
     100                , sizeof(audio_sample_format_t) ); 
     101        p_headphone_filter->p_module = module_Need( p_headphone_filter, "audio filter" 
     102                , "headphone" ); 
     103        if ( p_headphone_filter->p_module == NULL ) 
     104        { 
     105            vlc_object_detach( p_headphone_filter ); 
     106            vlc_object_destroy( p_headphone_filter ); 
     107 
     108            msg_Err( p_aout, "couldn't open the headphone virtual spatialization module" ); 
     109            aout_FifoDestroy( p_aout, &p_input->fifo ); 
     110            p_input->b_error = 1; 
     111            return -1; 
     112        } 
     113 
     114        /* success */ 
     115        p_headphone_filter->b_reinit = VLC_TRUE; 
     116        p_input->pp_filters[p_input->i_nb_filters++] = p_headphone_filter; 
    66117    } 
    67118 
  • src/libvlc.h

    r9e4b72d r84ae579  
    33 ***************************************************************************** 
    44 * Copyright (C) 1998-2002 VideoLAN 
    5  * $Id: libvlc.h,v 1.27 2002/12/07 22:29:15 titer Exp $ 
     5 * $Id: libvlc.h,v 1.28 2002/12/09 00:52:42 babal Exp $ 
    66 * 
    77 * Authors: Vincent Seguin <seguin@via.ecp.fr> 
     
    109109    "you notice a lag between the video and the audio.") 
    110110 
     111#define HEADPHONE_TEXT N_("headphone virtual spatialization effect") 
     112#define HEADPHONE_LONGTEXT N_( \ 
     113    "This effect gives you the feeling that you stands in a real room " \ 
     114    "with a complete 5.1 speaker set when using only a headphone, " \ 
     115    "providing a more realistic sound experience. It should also be " \ 
     116    "more comfortable and less tiring when listening to music for " \ 
     117    "long periods of time.\nIt works with any source format from mono " \ 
     118    "to 5.1.") 
     119 
     120#define HEADPHONE_DIM_TEXT N_("characteristic dimension") 
     121#define HEADPHONE_DIM_LONGTEXT N_( \ 
     122     "Headphone virtual spatialization effect parameter: "\ 
     123     "distance between front left speaker and listener in meters.") 
     124 
    111125#define VOUT_TEXT N_("video output module") 
    112126#define VOUT_LONGTEXT N_( \ 
     
    401415    add_integer( "desync", 0, NULL, DESYNC_TEXT, DESYNC_LONGTEXT ); 
    402416    add_integer( "audio-format", 0, NULL, FORMAT_TEXT, FORMAT_LONGTEXT ); 
     417    add_bool( "headphone", 0, NULL, HEADPHONE_TEXT, HEADPHONE_LONGTEXT ); 
     418    add_integer( "headphone-dim", 5, NULL, HEADPHONE_DIM_TEXT, 
     419                 HEADPHONE_DIM_LONGTEXT ); 
    403420 
    404421    /* Video options */